Hello there, I'm going completely insane with a new website of mine at the moment. I'm hosting with hostgator.com and they use an apache server. The problem is when I type my website name into the browser http://www.richandjobless.com for some reason it redirects to http://richandjobless.com For branding reasons I want to keep the www. The default .htaccess file reads as follows: # BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule> # END WordPress I've tried to edit the .htaccess file to redirect to www. by adding the following code: RewriteEngine On RewriteCond %{HTTP_HOST} ^richandjobless.com RewriteRule (.*) http://www.richandjobless.com/$1 [R=301,L] but it redirects back to www. then the non-www address in an infinite loop so it doesn't help much at all. Does any one have any ideas why this is happening and what I can do to fix it? FYI... I don't know if this helps but the contents of the index.php file that the .htaccess file refers to is as follows: <?php /* Short and sweet */ define('WP_USE_THEMES', true); require('./wp-blog-header.php'); ?> Any and all suggestions would be GREATLY appreciated. Thanks very much, Dave
The problem cant be solved via modding .htaccess. Your pages generated by php return redirect code. You have to dig wp-blog-header.php and find line like (may be after check for www prefix) header('Location: ....'); Code (markup): It causes redirection.
Check your WordPress admin panel. Go to "Options", then "General" and look at : WordPress address (URL) and Blog address (URL). I suspect that the problem is in one of these parameters. Jean-Luc
JEAN LUC!!!!!!!!!!!!!!!!! BUDDY!!!!!!!!! DO YOU KNOW HOW MUCH I LOVE YOU!!! That worked a treat! I'm not familiar with wordpress settings at all and just presumed it was the .htaccess file! YOU ARE A LEGEND MY FRIEND! Thanks again, Dave PS:Thanks for your suggestion too jmf000!