views:

78

answers:

3

I have a site that sits in a directory on a domain:

http://www.example.com/site/

I also have an .htaccess file in /site/ which has several rewrite rules. These rules work if all the files (including the .htaccess file) sit on the top-level of the domain: e.g., at www.example.com.

My .htaccess file looks something like this:

RewriteEngine On
RewriteBase /

RewriteRule ^css/loader/\d+/([^/]+)(\?(.*))?$  /loader.php?t=css&c=$1

I need the rules to work within the directory but I can't seem to figure out it, can anyone please help?

Edit: figured it out, server was on Apache 1.2+ which uses the POSIX regex engine as opposed to the PCRE engine in Apache2.

A: 

Change RewriteBase to /site/ instead of /

Eimantas
I've tried that...it doesn't work. I need:http://www.example.com/site/css/to go tohttp://www.example.com/site/loader.php
Calvin L
Also keep in mind that my .htaccess file must be in the /site directory...thanks for helping!
Calvin L
then try removing ^ from the request uri regexp, since ^ notes the beginning of url from the root. try using ^site/css
Eimantas
No go there either....
Calvin L
A: 

Don’t change the base URL (remove the RewriteBase directive) and use a relative path in your substitution:

RewriteRule ^css/loader/\d+/([^/]+)$  loader.php?t=css&c=$1
Gumbo
That didn't work for me either...
Calvin L
@Calvin L: What URL do you to test your rule?
Gumbo
+1  A: 

Edit: figured it out, server was on Apache 1.2+ which uses the POSIX regex engine as opposed to the PCRE engine in Apache2.

Calvin L