- Code: Select all
RewriteCond %{HTTP_HOST} ^(www\.)?mysite.com$
RewriteRule ^(.*)$ /mysite/$1
This works great but I'm running into an issue where typing a subdirectory name without a trailing slash exposes the directory name of the redirect (which makes for an ugly, redundant URL). For example:
A query to http://www.mysite.com/charts/ leaves this in the address bar, but a query to http://www.mysite.com/charts gets redirected to http://www.mysite.com/mysite/charts/
Does anyone know if there's any way around this? Thanks in advance!