Forum Moderators: phranque
RewriteRule ^sites/(.+)/static/$ /static.php?id=$1
so theres only one variable here, inbetween sites and static.
If I use RewriteRule ^sites/(.+)/static$ /static.php?id=$1
and load /sites/25/static it loads correctly. As soon as I add the trailing slash it 404s.
I've also tried several other rules all resulting in the same thing.
RewriteRule ^sites/([^/]+)/static/?$ /static.php?id=$1
"GET /sites/55/static/ HTTP/1.1" 404 28
"GET /sites/55/static HTTP/1.1" 200 1782
I'm running Apache/2.0.52 (Red Hat)
Odd thing is if I do this,
RewriteRule ^sites/([^/]+)/static/asdf.htm$ /static.php?id=$1
/sites/55/static/asdf.htm works. Unfortunately I dont want a filename here, trying to avoid duplicate urls at all costs. Can't understand why that rule would work, but without the asdf.htm wont work.
Any suggestions would be greatly appreciated.
BTW, your second version-- RewriteRule ^sites/([^/]+)/static/?$ /static.php?id=$1 --will be much more efficient than the version with the non-specific ".+" pattern. But of course, that doesn't matter until it works!
Jim