Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
force or no-www code for .htaccess
#1
GetSimple doesn't by default force a domain to use either www or no-www based on it's SITEURL that is setup within the administrative panel. You can add this code to force it to never use www in your URL:


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

Conversely, if you’d prefer to use “www” in all of your URLs, you can use this:

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

The code above should be included in your .htaccess file below the RewriteBase line, but before the RewriteCond %{REQUEST_FILENAME} !-f line.
- Chris
Thanks for using GetSimple! - Download

Please do not email me directly for help regarding GetSimple. Please post all your questions/problems in the forum!
Reply


Messages In This Thread
force or no-www code for .htaccess - by ccagle8 - 2010-01-03, 13:08:09
RE: force or no-www code for .htaccess - by Felix - 2020-08-20, 00:41:32
force or no-www code for .htaccess - by James - 2010-08-27, 08:06:31
force or no-www code for .htaccess - by yojoe - 2010-08-27, 08:42:27
force or no-www code for .htaccess - by James - 2010-08-27, 08:58:54
force or no-www code for .htaccess - by staseo - 2010-10-07, 08:18:50
force or no-www code for .htaccess - by yojoe - 2010-10-08, 04:47:41



Users browsing this thread: 1 Guest(s)