Solved

Using mod_rewrite when site is on subdomain

Posted on 2004-08-18
3
157 Views
Last Modified: 2010-03-04
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
Comment
Question by:Kyle93816
  • 2
3 Comments
 
LVL 51

Expert Comment

by:ahoffmann
ID: 11845022
did you miss the  RewriteCond ?
0
 

Author Comment

by:Kyle93816
ID: 11845917
I'm not sure.  I don't know what that means.
0
 
LVL 51

Accepted Solution

by:
ahoffmann earned 250 total points
ID: 11849843
# assuming that your given URL is not index.php, then prepend your rewriteRule by:

RewriteCond %{REQUEST_URI} !index.php
0

Featured Post

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction As you’re probably aware the HTTP protocol offers basic / weak authentication, which in combination with the relevant configuration on your web server, provides the ability to password protect all or part of your host.  If you were not…
If your site has a few sections that need to be secure when data is transmitted between the server and local computer, such as a /order/ section for ordering or /customer/ which contains customer data, etc it would of course be recommended to secure…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, just open a new email message. In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

867 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now