Hi,
I need help rewriting URLs in Apache. I want the 'www.' to be stripped while preserving the directory structure. For example: If a user types 'www.hex1a4.net/mirror/openoffice/' the URL should be rewritten as 'hex1a4.net/mirror/openoffice/' and the root of my OpenOffice mirror should be shown.
I'm having a really hard time coming up with the correct rewrite conditions. So far I was able to come up with the following:
Code:
RewriteCond %{HTTP_HOST} ^www.hex1a4.net$
RewriteRule ^(.*)$ http://hex1a4.net/ [R=301,L]
but this doesn't doesn't take into account the directory structure and regardless of the path specified, if the address is prefixed with 'www.' the home page will always be displayed.
Please note that I am not the admin of the system and don't have access to Apache's configuration files. I can only use .htaccess.The Apache version is 1.3.37