vBulletin Search Engine Optimization
This is a discussion on .htaccess Question RE: www and no www within the General Discussion forums, part of the vBSEO SEO Plugin category; Hello, My site has a .htaccess in the root which redirects calls to stop SE's thinking I have duplicate content ...
| |||||||
Enhancing 80 million pages. | Register | FAQ | Members List | Social Groups | Calendar | Search | Today's Posts | Mark Forums Read |
|
#1
| |||
| |||
|
Hello, My site has a .htaccess in the root which redirects calls to stop SE's thinking I have duplicate content Code: # Rule for duplicate content removal : domain.com - Get online with a domain name and web hosting vs domain.com # RewriteCond %{HTTP_HOST} ^mysite\.com$ [NC] # RewriteRule (.*)$ Website Hosting - Mysite.com [R=301,L,NC] Code:
RewriteCond %{HTTP_HOST} !^www\.mysite\.com
RewriteRule (.*) Website Hosting - Mysite.com [L,R=301]
This means that my main html site no longer has the redirect working :( Can anybody tell me how I could get both redircts working? Thanks VinylJunky |
|
#2
| ||||
| ||||
|
You should remove "#" characters for rewrite rules in domain root since they are used to disable (comment out) directives.
__________________ Oleg Ignatiuk / Crawlability Inc. vBSEO 3.2.0 Launched - Maximum Overdrive for Your Web Traffic! Over 100 Instant SEO Optimizations vBSEO Google Sitemap Generator - Version 2.2 Released Mandatory Upgrade for vBSEO 3.2.0 GOLD 6X Traffic - $1400 in One Day with vBSEO! Imagine What the vBSEO Patent Pending Technology Can Do For You. |
|
#3
| |||
| |||
| Quote:
The one in my site root used to work until I activated the VBSEO one in the forum root :( Sorry for the confussion. Any ideas how I get them both working? Thanks VinylJunky |
|
#4
| ||||
| ||||
|
In your case, you would have this in the .htaccess in your forum root: RewriteCond %{HTTP_HOST} !^www\.yourdomain\.com RewriteRule (.*) http://www.yourdomain.com/forum/$1 [L,R=301] That should not affect anything in your site root, however.
__________________ Keith Cohen / Crawlability Inc. vBSEO 3.2.0 Launched - Maximum Overdrive for Your Web Traffic! Over 100 Instant SEO Optimizations vBSEO Google Sitemap Generator - Version 2.2 Released Mandatory Upgrade for vBSEO 3.2.0 GOLD 6X Traffic - $1400 in One Day with vBSEO! Imagine What the vBSEO Patent Pending Technology Can Do For You. My Personal Sites: My Blog | GPS Discussion Forum |
|
#5
| |||
| |||
|
Seems to work fine Thanks VinylJunky |
|
#6
| |||
| |||
|
I have found a small problem .mysitez.com gets refered to www.mysitez.com .mysitez.com/forum/ gets refered to www.mysitez.com/forum .mysitez.com/forum doesnt refer to www.mysitez.com/forum it stays at .mysitez.com/forum and shows Page Cannot Be Found 404 How weird Anybody any ideas? Thanks VinylJunky |
|
#7
| ||||
| ||||
|
Try this (in Root folder, not forum folder) Code: RewriteCond %{HTTP_HOST} !^www\.mysitez\.com$ [NC]
RewriteRule ^(.*)$ http://www.mysitez.com$1 [R=301,L]
|
|
#8
| |||
| |||
| Quote:
Im puzzled :( VinylJunky |
|
#9
| ||||
| ||||
|
Have you dissable it in the .htaccess File in "Forum root" (forum Folder) at the same time? T |
|
#10
| ||||
| ||||
| Quote:
__________________ Keith Cohen / Crawlability Inc. vBSEO 3.2.0 Launched - Maximum Overdrive for Your Web Traffic! Over 100 Instant SEO Optimizations vBSEO Google Sitemap Generator - Version 2.2 Released Mandatory Upgrade for vBSEO 3.2.0 GOLD 6X Traffic - $1400 in One Day with vBSEO! Imagine What the vBSEO Patent Pending Technology Can Do For You. My Personal Sites: My Blog | GPS Discussion Forum |
|
#11
| |||
| |||
|
I still get this behaviour .mysitez.com gets refered to www.mysitez.com .mysitez.com/forum/ gets refered to www.mysitez.com/forum .mysitez.com/forum doesnt refer to www.mysitez.com/forum I'd like .mysitez.com/forum to go to www.mysitez.com/forum These are my .htaccess files siteroot/.htaccess Code: # mod_rewrite in use # Options +FollowSymlinks RewriteEngine On # Uncomment following line if your webserver's URL # is not directly related to physical file paths. # RewriteBase / # Rule for duplicate content removal : domain.com - Get online with a domain name and web hosting vs domain.com RewriteCond %{HTTP_HOST} !^www.mysitez.com$ [NC] RewriteRule ^(.*)$ http://www.mysitez.com$1 [R=301,L] # Rule to redirect sitemaps RewriteRule ^((urllist|sitemap).*.(xml|txt)(.gz)?)$ forum/vbseo_sitemap/vbseo_getsitemap.php?sitemap=$1 [L] # ErrorDocument 404 http://www.mysitez.com/error404.htm /forum .htaccess Code:
RewriteEngine On
# Some servers require the Rewritebase directive to be
# enabled (remove '#' at the beginning to activate)
# Please note: when enabled, you must include the path
# to your root vB folder (i.e. RewriteBase /forums/)
# RewriteBase /forum/
# Already stated in site root
# RewriteCond %{HTTP_HOST} !^www.mysitez.com
# RewriteRule (.*) http://www.mysitez.com/forum/$1 [L,R=301]
RewriteRule ^((urllist|sitemap_).*.(xml|txt)(.gz)?)$ vbseo_sitemap/vbseo_getsitemap.php?sitemap=$1 [L]
RewriteCond %{QUERY_STRING} !vbseourl=
RewriteCond %{REQUEST_URI} !(admincp/|modcp/|chat|cron)
RewriteRule ^(.*.php(/.*)?)$ vbseo.php?vbseourl=$1 [L,QSA]
RewriteCond %{REQUEST_FILENAME} !.(jpg|gif)$
RewriteRule ^(archive/.*)$ vbseo.php?vbseourl=$1 [L,QSA]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !^(admincp|modcp|clientscript|cpstyles|images)/
RewriteRule ^(.+)$ vbseo.php?vbseourl=$1 [L,QSA]
Thanks VinylJunky |
|
#12
| ||||
| ||||
|
It looks like you didn't do what is suggested here: Add www to forum url with no trailing slash That needs to be done in your Forum .htaccess, and you will need to uncomment those lines.
__________________ Keith Cohen / Crawlability Inc. vBSEO 3.2.0 Launched - Maximum Overdrive for Your Web Traffic! Over 100 Instant SEO Optimizations vBSEO Google Sitemap Generator - Version 2.2 Released Mandatory Upgrade for vBSEO 3.2.0 GOLD 6X Traffic - $1400 in One Day with vBSEO! Imagine What the vBSEO Patent Pending Technology Can Do For You. My Personal Sites: My Blog | GPS Discussion Forum |
|
#13
| |||
| |||
| Quote:
It works now, I owe you a beer I added this line to forum/.htaccess RewriteCond %{REQUEST_URI} forum/ Thank you, I can now stop banging my head on the keyboard. The help I get in this forum is exceptional VinylJunky |
|
#14
| ||||
| ||||
|
You welcome.
|