Forum Moderators: phranque
All I am trying to do is make it so that any request for the site at [mysite.com...] is redirected to [mysite.com...]
Any help would be greatly appreciated, and once again, sorry for posting such an elementary question.
Welcome to WebmasterWorld!
> and trying some things with my .htaccess file that haven't been working at all.
Please post your code and test results as a basis for discussion.
Also, our forum charter [webmasterworld.com] contains links to documentation that may help you get started.
Jim
RewriteEngine on
RewriteCond %{HTTP_HOST}!^www\.mydomain\.com [NC]
RewriteCond %{HTTP_HOST}!^$
RewriteRule ^/(.*) [mydomain.com...] [L,R]
One odd behavior though is that if I type 'mydomain.com/dir' into the browser, it re-directs successfully to 'www.mydomain.com/dir'. However, if while I'm there I erase the 'www.', and go to that destination, the redirect does not take place, I go to 'mydomain.com/dir'. But if I then replace '/dir' with '/dir2' and do not add a 'www.', when I navigate to that page the redirect works again, and I am sent to the location with the 'www.' present.
I assume this has something to do with Apache not handling the reloading of a page this way the same way it handles other requests, or is there something else I am missing?
Thanks again!
Apache won't 'handle the reloading of a page' if the request is not sent to your server... Flush your browser cache (and any other cache you may have, such as your local-network proxy cache) before *each* test of any access-control code. Alternatively, set your browser so that it does not cache pages from your domains while you are testing.
Jim