Forum Moderators: phranque
I added the code below to an .htaccess file
# Make sure always goes to "www"
RewriteEngine On
RewriteCond %{HTTP_HOST} ^example.org
RewriteRule (.*) http://www.example.org/$1 [R=301,L]
However, for example in a browser http://example.org/news/ now goes
to http://www.example.org/public_html/news/ (why does it add the "public_html" part?)
Which gives an error.
Must be something foolish I am overlooking?
Thank you in advance
[edited by: jdMorgan at 1:36 pm (utc) on Oct. 11, 2005]
[edit reason] Examplified [/edit]
Also, if you are using a 'control panel' to define domains or subdomains for multiple sites, there may be a problem in the control panel settings or in the code that it generates and places in httpd.conf.
Jim
I have not heard back in a couple of days to know how things ended up, but the last suggestion was to try a 'band-aid' and either convince the host (which would not offer support) that there was a configuration error, or find a new host.
This is not ideal, but may work:
RewriteEngine on
RewriteCond %{HTTP_HOST} ^example\.com [NC]
RewriteCond %{REQUEST_URI} (.*)
RewriteRule .? http://www.example.com%1 [R=301,L]
Please, let me know if you try it.
Justin