I have changed the URL in system configuration without www. Also I replaced all instances of www.example.com with example.com in database. But When I regenerate, all rewrites in the directory URLs come back to www.example.com
Am I missing a step somewhere or is there any code in htaccess which is to be removed?
Comments on To access via non -www
Usergroup: Member
Joined: Apr 04, 2011
Total Topics: 7
Total Comments: 10
I am able to redirect using following code in htaccess
RewriteCond %{HTTP_HOST} ^www\.(([a-z0-9_]+\.)?example\.com)$ [NC]
RewriteRule .? http://%1%{REQUEST_URI} [R=301,L]
I have changed the URL in system configuration without www. Also I replaced all instances of www.example.com with example.com in database. But When I regenerate, all rewrites in the directory URLs come back to www.example.com
Am I missing a step somewhere or is there any code in htaccess which is to be removed?
Usergroup: Member
Joined: Apr 04, 2011
Total Topics: 7
Total Comments: 10
I could finally fix the rewrite.
config.php file still had the $dirurl=http://www.example.com despite changing URL in system configuration to http://example.com
developer
Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California
Total Topics: 61
Total Comments: 7868
Check which box you're changing. There's the overall site URL box, and then there's the WSN Links URL box which is the one that config.php uses.