Mod_rewrite not working?


#1

Hi,

I’m trying to put working this Rewrite rules:

rewriteEngine on rewriteRule ^/projects/+$ /projects/index.html [L] rewriteCond /home/tenak/lib/trac/$1 -d rewriteRule ^/projects/([[:alnum:]]+)(/?.*) /cgi-bin/trac.cgi$2 [S=1,E=TRAC_ENV:/home/tenak/trac/$1] rewriteRule ^/projects/(.*) /projects/index.html Instead the expected result, I get a 404 when try to access /projects/foo

I have also tried with Rewrite* (R capitalized).

What I’m doing wrong?

Thanks


#2

Leave off the leading slash in the paths you want rewritten. Eg,

rewriteRule ^/projects/+$ should be

rewriteRule ^projects/+$

If you want useful replies, ask smart questions.


#3

Hi,

it works! But… :frowning:

Now the CGI complains about the TRAC_ENV var. not set, and in the .htaccess should be set. It seems that doesn’t do the assignment… what could be the mistake?

Thanks again


#4

I have found a workaround to make it works.