• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 167
  • Last Modified:

Using mod_rewrite when site is on subdomain

Hi, I'm trying to use mod_rewrite to produce clean URI's, but the page won't load after I make the required changes to the .htaccess file.

I'm setting up a photo site on a subdomain of my main site, and I think I may need a different value for RewriteBase (instead of a subfolder) because of that.  Hoping someone can point me in the right direction.  Thanks!


RewriteEngine on
RewriteBase /subfolder/

RewriteRule    ^(.*)/(.*)?/?$    index.php?a=$1&i=$2   [QSA]
RewriteRule    ^(.*)?/?$    index.php?a=$1   [QSA]
  • 2
1 Solution
did you miss the  RewriteCond ?
Kyle93816Author Commented:
I'm not sure.  I don't know what that means.
# assuming that your given URL is not index.php, then prepend your rewriteRule by:

RewriteCond %{REQUEST_URI} !index.php
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now