- Code: Select all
#loop stopping code.
RewriteCond %{ENV:REDIRECT_STATUS} 200
RewriteRule ^ - [L]
#if address is www, redirect to /main/
RewriteCond %{HTTP_HOST} ^www\.web\-site\.net$ [NC]
RewriteRule ^(.*)$ /main/$1 [QSA,L]
#if address is img, redirect to /images/
RewriteCond %{HTTP_HOST} ^img\.web\-site\.net$ [NC]
RewriteRule ^(.*)$ /images/$1 [QSA,L]
#if none of these are the case, execute redirect to /users/
RewriteRule ^(.*)$ /users/$1 [QSA,L]
So, to sum that up, img.web-site.net reads from the /images/ folder, any username on the site (hank.web-site.net) reads from /users/ (username is grabbed from the url with php) and www reads from /main/. and subfolders and the query string are appended...
It works fine with this address: http://www.web-site.net/browse/. however, if you enter http://www.web-site.net/browse (notice, no trailing slash) it redirects to http://www.web-site.net/main/browse/.
which it shouldn't do =\
Does anyone have any ideas on how to fix this?