Wiki

New Case Case Status
Log In

Wiki

 
WWW and non-WWW Issues
  • RSS Feed

Last modified on 1/31/2010 3:15 PM by User.

Tags:

WWW and non-WWW Issues

 

When you register a new site with Datafeed Studiio it strictly binds to the URL you provide, so if you input "example.com" as your URL, this will NOT match users browsing to "www.example.com". 

To fix this, you may want to add the following lines to the .htaccess file present in the root folder of the application. These should be placed immediately after the "Rewrite Base ..." line.

# redirect if www.example.com (case-insensitive) to example.com 

RewriteCond %{HTTP_HOST} ^www\.example\.com [NC] 

RewriteRule (.*) http://example.com/$1 [R=301,L]     

To do it the other way around and force non-www to www use the following lines instead :

RewriteCond %{HTTP_HOST} ^example.com
RewriteRule (.*) http://www.example.com/$1 [R=301,L]

Also be aware that if you install Datafeed Studio in a sub-folder, .e.g. http://example.com/mystore then you will need to update the RewriteBase rule in the .htaccess file, changing the target from "/" to "/mystore".