Hopefully this will help someone now or in the future.
If you ever install a fresh WP (often via fantastico), some servers (shared hosts especially) will get pissy when it comes to www and no www.
As most of you know already, .htaccess can be edited to redirect all no-www requests to a www. ie; http://site.com redirects to www.site.com.
This traditionally looks like:
Now...as I mentioned, WP has issues sometimes. This can sum it up way better than I can.
If WP doesn't have access to your .htaccess, it will request that you manually update it. So, in total, my .htaccess file for a shared host that requires this kind of tinkering looks like this:
Hope that's useful in the future to someone.
Now...if anyone has suggestions to make this process easier, say so. Also, feel free to flame me as a n00b if there's some profoundly easier fix.
If you ever install a fresh WP (often via fantastico), some servers (shared hosts especially) will get pissy when it comes to www and no www.
As most of you know already, .htaccess can be edited to redirect all no-www requests to a www. ie; http://site.com redirects to www.site.com.
This traditionally looks like:
Code:
<Files 403.shtml>
order allow,deny
allow from all
</Files>
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} !^www.YOURSITE.com$ [NC]
RewriteRule ^(.*)$ http://www.YOURSITE.com/$1 [L,R=301]
Sometimes changing your permalinks is also necessary. I generally do something like /%category%/%postname%/. You should change your permalinks anyways, for SEO purposes.WordPress 2.3 includes a new canonical redirect feature. It is designed to deal with such problems as Google seeing yoursite.com and E-Commerce Hosting as two different entities.
Some hosting providers offer a similar redirect feature. With DreamHost, for example, you can configure your domain so that the web server redirects any request for E-Commerce Hosting to yoursite.com (i.e., it removes the www prefix).
When both of these features are enabled at the same time, they conflict with each other. You will experience HTTP errors such as:Too many HTTP redirectsor:
Firefox has detected that the server is redirecting the request for this address in a way that will never complete.To fix this problem, you must go to the WordPress admin page and switch to the Options > General section. For the WordPress address and Blog address entries, remove the www prefix from both URLs.
Source: #5306 (Canonical redirect conflicts with hosting provider's redirect) - WordPress Trac - Trac
If WP doesn't have access to your .htaccess, it will request that you manually update it. So, in total, my .htaccess file for a shared host that requires this kind of tinkering looks like this:
Code:
<Files 403.shtml>
order allow,deny
allow from all
</Files>
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} !^www.DOMAIN.com$ [NC]
RewriteRule ^(.*)$ http://www.DOMAIN.com/$1 [L,R=301]
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
Now...if anyone has suggestions to make this process easier, say so. Also, feel free to flame me as a n00b if there's some profoundly easier fix.