Menu Content

Podpora

> Diskusní fóra, FAQs & placená podpora
Welcome, Guest
Username Password: Remember me

non-www URLs to www URLs
(1 viewing) (1) Guest
Support forum for users using free edition of JoomSEF 3 (Joomla 1.5 compatible). These forums are mainly for mutual help between users.

Please note that due to our capacity limitations, we do not monitor these forums regularly.
  • Page:
  • 1

TOPIC: non-www URLs to www URLs

non-www URLs to www URLs 16 years, 1 month ago #5113

All of my SEF URLs, links, etc. are not www in the URL. I would like to add this. How can I do this?

Re:non-www URLs to www URLs 16 years, 1 month ago #5150

Hi Ben,

you need to make this a setting for your entire site in the .htaccess file that resides in the root directory of your site. There are several versions of this on the web - google for "htaccess www redirect" or something similar

Example 1 - Redirect domain.com to www.domain.com

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

Example 2 - Redirect www.domain.com to domain.com

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

Doing this means that entering either mysite.com or www.mysite.com will redirect to whichever you define as the primary. It also means you will not be hit by a google duplicate content penalty.

HTH

Paul

Noise & stuff
www.bingbangbong.com
  • Page:
  • 1
Přihlášení uživatele Prázdný