On a local network, I have some URLs that I want to make easier. For example:
Actual path:
http://localserver/sites/website.com/html
Which I want to access with:
http://localserver/website
I don’t want the full path to be shown.
I have this in my .htaccess file:
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI} ^/website
RewriteRule ^website(.com)?(/.*)?$ /sites/website.com/html$2 [P,L]
It works as expected when there’s a trailing slash or a file in the request, but if there isn’t it redirects to the full path.
These work:
These redirect to the real path:
What do I need to change to always mask the path?
If you are running multiple sites on your localhost server, it would suggest doing this: http://drupal.org/node/161975
If that doesn’t apply in your case, this post will solve your problem:
invisible mod_rewrite is not always invisible!? ("www" and "without subdomain")