Hiya,
I'm trying to rewrite a url of this: http://www.foo.com/bar/baz
to
index.php?q=$1&d=baz
Where bar is not a fixed value, but baz is.
RewriteRule ^(.*)\/baz$ index.php?q=$1&d=baz [L,QSA]
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
What i have above kinda works but unfortunately breaks all the includes in the site (css/javascript) but strangely all the pages work :/
This is a drupal install, (so the second line needs to remain).
UPDATE
This might help actually, i forgot to include
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !=/favicon.ico
**RewriteRule ^(.*)/details index.php?q=$1&details=true [L,QSA]**
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
It seems to be doing my rewrite correctly, the only problem is it's ignoring the other conditional statements now, i.e. it's still attempting to rewrite files that exist (i.e. css,js) when it's mean to avoid them.
site is fine without my line (The one with the stars), but with it, the variables and pages work, but static files like css etc are also being rewritten....need to stop that!
Thanks in advance.
Shadi