User Tools

Site Tools


site_www_prefix_issues

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
site_www_prefix_issues [2016/05/17 16:13]
admin
site_www_prefix_issues [2017/03/02 20:51] (current)
admin
Line 1: Line 1:
-Sometimes **www.mysite.com** and **mysite.com** can react as different domains. If you type in your URL using the www prefix but you have your site's baseurl defined without the the www prefix in the "​**includes/​defines.inc.php**"​ file, it can cause potential issues such as logging a user out because it's recognizing your site url with the www prefix and non-www prefix as different domains.+Sometimes **www.mysite.com** and **mysite.com** can react as different domains. If you type in your URL using the www prefix but you have your site's baseurl defined without the the www prefix in the "​**includes/​defines.inc.php**"​ file, it can cause potential issues such as logging a user out when navigating the site, or during ​the registration process when user attempts to select their state and/or city it continues to try and load but never does.
  
-You can force the WWW prefix to be included in your domain URL so your site doesn'​t create any potential conflicts as being viewed as 2 different domains with WWW and non-WWW prefixes.+You can force the WWW prefix to be included in your domain URL so your site doesn'​t create any potential conflicts as being viewed as 2 different domains with WWW and non-WWW prefixes. It's always not necessary but depending on how your domain and server are configured it's best to include this in your .htaccess file just to ensure there'​s no potential conflicts on how your URL gets resolved
  
 Open your **.htaccess** file and add the following code: Open your **.htaccess** file and add the following code:
Line 10: Line 10:
 Just make sure that you replace the mysite.com with your actual domain name. If you're going to force the www prefix in your .htaccess file, in your **includes/​defines.inc.php** file also make sure your **baseurl** is defined with the www prefix. Just make sure that you replace the mysite.com with your actual domain name. If you're going to force the www prefix in your .htaccess file, in your **includes/​defines.inc.php** file also make sure your **baseurl** is defined with the www prefix.
 >><​code>​define('​_BASEURL_','​http://​www.mysite.com'​);//​ protocol required (http:// )</​code>​ >><​code>​define('​_BASEURL_','​http://​www.mysite.com'​);//​ protocol required (http:// )</​code>​
 +
 +**NOTE** - You can alternately not use the WWW prefix, just make sure that the .htaccess RewriteRule and the baseurl in your defines file are both consistent and do do not have the www prefix included.
 +
 +   
 +For more info also see: [[the_.htaccess_file|The .htaccess File]]
site_www_prefix_issues.1463501593.txt.gz ยท Last modified: 2016/05/17 16:13 by admin