• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 169
  • 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!


Code:

RewriteEngine on
RewriteBase /subfolder/

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

RewriteCond %{REQUEST_URI} !index.php
0
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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

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