Code Snippet </> Info
Snippet Name: WWW / No-WWW
Description: You should choose to either use the http://www.domain.com or http://domain.com address for uniformity and SEO purposes.
Note: Choose to use the .www or not by selecting the appropriate code snippet.
Author:
Last Modified: 2014-05-18 16:47:57
Language: .htaccess
Highlight Mode: html
|
Copy Codes: Use Free Notepad ++ |
|
Snap HTML Code Editor: Paste the source code, make changes and instantly see it in live preview. Snap HTML Code Editor
|
|
Copied To Clipboard!
Use the code below if you want to force your server to write the .WWW in the address bar.
#Begin Force .WWW In URL Bar
RewriteEngine On
RewriteCond %{HTTP_HOST} !^your-site.com$ [NC]
RewriteRule ^(.*)$ http://www.your-site.com/$1 [L,R=301]
# // --> End
+++ or +++
Use the code below if you want to force your server to write NO - .WWW in the address bar.
#Begin Force NO - .WWW In URL Bar
RewriteEngine On
RewriteCond %{HTTP_HOST} !^your-site.com$ [NC]
RewriteRule ^(.*)$ http://your-site.com/$1 [L,R=301]
# // --> End
|