Hi There,
I'm re-writing a subdomain to a 'folder' - actually a page in wordpress, and this all seems to be working correctly. I don't want the address in the URL bar to change though.
Everything works fine unless the user does not put a trailing slash after the page name, then the page is still redirected to the correct URL but the URL in the address bar changes
For example: foo.example.com/bar Becomes: public.example.com/foo/bar
Where : foo.example.com/bar/ stays at the correct URL in the address bar but shows the redirected page (this is correct)
What rule do i need to add to add in a trailing slash if its not sent?
The code i have so far is:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
Options +FollowSymlinks
RewriteCond %{HTTP_HOST} ^foo\.example\.com$ [NC]
RewriteRule ^(.*)$ http://public.example.com/foo/$1 [P]
# rules for WordPress ...
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
#####
</IfModule>
Any help would be fantastic, I'm pretty new to htaccess. Thanks!