Im using the code you suggested to redirect www.mydomain.com/alias to www.mydomain.com/start.php?a=xyz. This works great, until users type in a trailing slash (www.mydomain.com/alias/) in which case the image URLs break.
images should load from:
www.mydomain.com/img/image1.gif
with the trailing slash they load from:
www.mydomain.com/alias/img/image.gif
My current code:
- Code: Select all
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} /data/ [OR]
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.* - [QSA,L]
RewriteRule ^([a-z0-9]+)/? start.php?a=$1 [QSA,L]
The following is usually suggested, but wont work in my case:
- Code: Select all
RewriteRule ^([^/]+)/([^/]*)/?$ /start.php?a=$1 [L]
Thanks for your help.
Mat
PS. Out of interest, do I really need the QSA to retain the QueryString?