Hi,
I want to put a code that redirects non-www to www. Is that bad and is it bad for vbseo?
This is a discussion on redirect non-www to www within the General Discussion forums, part of the vBSEO SEO Plugin category; Hi, I want to put a code that redirects non-www to www. Is that bad and is it bad for ...
Hi,
I want to put a code that redirects non-www to www. Is that bad and is it bad for vbseo?
It's good.
What is the best way to go about doing that?
In your root .htaccess, and in your forums .htaccess:
Make sure it's above your other RewriteCond's in both files, but under the RewriteEngine On.Code:RewriteCond %{HTTP_HOST} !^www\.yourdomain\.com RewriteRule (.*) http://www.yourdomain.com/$1 [R=301,L]
Outstanding, thanks!
I am probably learning more from this forum that any other one I have been on. And I definately have alot to learn.![]()
(See edit above.)
In forums .htaccess it will need the forum path?Code:RewriteCond %{HTTP_HOST} !^www\.yourdomain\.com RewriteRule (.*) http://www.yourdomain.com/$1 [R=301,L]
otherwise it will push it back to the homepage.Code:RewriteCond %{HTTP_HOST} !^www\.yourdomain\.com RewriteRule (.*) http://www.yourdomain.com/fourmpath/$1 [R=301,L]
Correct. I forgot to differentiate.
Code:#root .htaccesssRewriteCond %{HTTP_HOST} !^www\.sportsoutlaw\.com RewriteRule (.*) http://www.sportsoutlaw.com/$1 [R=301,L]Code:#forum .htaccesssRewriteCond %{HTTP_HOST} !^www\.sportsoutlaw\.com RewriteRule (.*) http://www.sportsoutlaw.com/forum/$1 [R=301,L]
Last edited by Ashley; 12-28-2005 at 09:38 PM.
well, it worked for my forum, but not for my root.
Worked for me when I went to http://sportsoutlaw.com
show us whats in your root .htaccess
And me.Originally Posted by ConqSoft
Code:# -FrontPage-AddType application/x-httpd-php .php .htm .htmlIndexIgnore .htaccess */.??* *~ *# */HEADER* */README* */_vti*order deny,allowdeny from allallow from allorder deny,allowdeny from allAuthName www.sportsoutlaw.comAuthUserFile /home/sportsou/public_html/_vti_pvt/service.pwdAuthGroupFile /home/sportsou/public_html/_vti_pvt/service.grpRewriteEngine onRewriteCond %{HTTP_HOST} !^www\.sportsoutlaw\.com RewriteRule (.*) http://www.sportsoutlaw.com/$1 [R=301,L]RewriteCond %{HTTP_REFERER} !^$RewriteCond %{HTTP_REFERER} !^http://sportsoutlaw.com/.*$ [NC]RewriteCond %{HTTP_REFERER} !^http://sportsoutlaw.com$ [NC]RewriteCond %{HTTP_REFERER} !^http://thesportstavern.com/.*$ [NC]RewriteCond %{HTTP_REFERER} !^http://thesportstavern.com$ [NC]RewriteCond %{HTTP_REFERER} !^http://www.sportsoutlaw.com/.*$ [NC]RewriteCond %{HTTP_REFERER} !^http://www.sportsoutlaw.com$ [NC]RewriteCond %{HTTP_REFERER} !^http://www.thesportstavern.com/.*$ [NC]RewriteCond %{HTTP_REFERER} !^http://www.thesportstavern.com$ [NC]RewriteRule .*\.(jpg|jpeg|gif|png|bmp)$ - [F,NC]RewriteRule ^(sitemap.*\.(xml|txt)(\.gz)?)$ /forum/vbseo_sitemap/vbseo_getsitemap.php?sitemap=$1 [L]
# -FrontPage-AddType application/x-httpd-php .php .htm .htmlIndexIgnore .htaccess */.??* *~ *# */HEADER* */README* */_vti*order deny,allowdeny from allallow from allorder deny,allowdeny from allAuthName www.sportsoutlaw.comAuthUserFile /home/sportsou/public_html/_vti_pvt/service.pwdAuthGroupFile /home/sportsou/public_html/_vti_pvt/service.grpRewriteEngine onRewriteCond %{HTTP_HOST} !^www\.sportsoutlaw\.com RewriteRule (.*) http://www.sportsoutlaw.com/$1 [R=301,L]RewriteCond %{HTTP_REFERER} !^$RewriteCond %{HTTP_REFERER} !^http://sportsoutlaw.com/.*$ [NC]RewriteCond %{HTTP_REFERER} !^http://sportsoutlaw.com$ [NC]RewriteCond %{HTTP_REFERER} !^http://thesportstavern.com/.*$ [NC]RewriteCond %{HTTP_REFERER} !^http://thesportstavern.com$ [NC]RewriteCond %{HTTP_REFERER} !^http://www.sportsoutlaw.com/.*$ [NC]RewriteCond %{HTTP_REFERER} !^http://www.sportsoutlaw.com$ [NC]RewriteCond %{HTTP_REFERER} !^http://www.thesportstavern.com/.*$ [NC]RewriteCond %{HTTP_REFERER} !^http://www.thesportstavern.com$ [NC]RewriteRule .*\.(jpg|jpeg|gif|png|bmp)$ - [F,NC]RewriteRule ^(sitemap.*\.(xml|txt)(\.gz)?)$ /forum/vbseo_sitemap/vbseo_getsitemap.php?sitemap=$1 [L]