vBulletin SEO Forums

SEO

vBulletin Search Engine Optimization

Buy vBSEO Now! HACKER SAFE certified sites prevent over 99.9% of hacker crime.
ne nw
New vBSEO Discount Level for Network Builders Meet vBSEO Team in New York (Nov. 3rd & 4th) vBSEO 3.2.0 GOLD Has Landed Success with vBSEO = 600ore Web Visitors + $1400 in a Day! Crawlability Inc. Files for SEO Technology Patent
se sw

Redirecting the xxx.com to www.xxx.com

This is a discussion on Redirecting the xxx.com to www.xxx.com within the General Discussion forums, part of the vBSEO SEO Plugin category; Hi, I noticed today that my website can be visited via both www and without www url. Code: RewriteCond %{HTTP_HOST} ...

Go Back   vBulletin SEO Forums > vBSEO SEO Plugin > General Discussion

Enhancing 80 million pages.

Register FAQ Members List Social Groups Calendar Search Today's Posts Mark Forums Read
  #1  
Old 11-21-2007, 01:03 PM
NeutralizeR's Avatar
Senior Member
Big Board Administrator
 
Real Name: Mavi KARANLIK
Join Date: Feb 2006
Location: Ankara/TÜRKİYE
Posts: 296
Question Redirecting the xxx.com to www.xxx.com

Hi,

I noticed today that my website can be visited via both www and without www url.

Code:
RewriteCond %{HTTP_HOST} !^www\.msxlabs\.org
RewriteRule (.+) http://www.msxlabs.org%{REQUEST_URI} [R=301,L]
It's redirecting the file requests to www version but i want to disable direct msxlabs.org accessing.

Example:
msxlabs.org/legend.php is redirected to www.msxlabs.org/legend.php

Domain access:
msxlabs.org - www.msxlabs.org

What's wrong or missing?

Btw, vbseo.com is redirected to www.vbseo.com

Apache 2.2.6 (PHP 5.2.5)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2  
Old 11-21-2007, 01:06 PM
Keith Cohen's Avatar
vBSEO Staff
vBSEO Total Customer SupportBig Board Administrator
 
Real Name: Keith Cohen
Join Date: Jul 2005
Location: Raleigh, NC USA
Posts: 6,265
Blog Entries: 1
What is the entire contents of the .htaccess in the root of the site?

The lines you need would be:

RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\.msxlabs\.org
RewriteRule (.*) http://www.msxlabs.org/$1 [L,R=301]
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3  
Old 11-21-2007, 01:25 PM
NeutralizeR's Avatar
Senior Member
Big Board Administrator
 
Real Name: Mavi KARANLIK
Join Date: Feb 2006
Location: Ankara/TÜRKİYE
Posts: 296
Quote:
Originally Posted by Keith Cohen View Post
What is the entire contents of the .htaccess in the root of the site?

The lines you need would be:

RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\.msxlabs\.org
RewriteRule (.*) MsXLabs Hi-Tech Forum - MaviKaranlik.com: “Karanl???n Mavi Yüzü...” [L,R=301]
Code:
<Directory /home/msxorg/public_html>
Options All -Indexes
RewriteEngine on
RewriteCond %{HTTP_HOST} !^www\.msxlabs\.org
RewriteRule (.+) http://www.msxlabs.org%{REQUEST_URI} [R=301,L]
RewriteCond %{HTTP_REFERER} !^http://www.msxlabs.org/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^http://www.msxlabs.org$      [NC]
RewriteCond %{HTTP_REFERER} !^$
RewriteRule .*\.(jpg|jpeg|gif|png|bmp|swf|mp3|mpeg|mpg|ram|rm|wma|wav|asx|wmv|avi|mov|zip|rar|exe)$ http://www.msxlabs.org [NC,R,L]
RewriteRule ^((urllist|sitemap).*\.(xml|txt)(\.gz)?)$ forum/vbseo_sitemap/vbseo_getsitemap.php?sitemap=$1 [L]
#ErrorDocument 404 /forum/ [R=301,L]
</Directory>

<Directory /home/msxorg/public_html/forum>
Options All -Indexes
RewriteEngine on
RewriteCond %{HTTP_HOST} !^www\.msxlabs\.org
RewriteRule (.+) http://www.msxlabs.org%{REQUEST_URI} [R=301,L]
RewriteCond %{HTTP_REFERER} !^http://www.msxlabs.org/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^http://www.msxlabs.org$      [NC]
RewriteCond %{HTTP_REFERER} !^$
RewriteRule .*\.(jpg|jpeg|gif|png|bmp|swf|mp3|mpeg|mpg|ram|rm|wma|wav|asx|wmv|avi|mov|zip|rar|exe)$ http://www.msxlabs.org [NC,R,L]
RewriteCond %{QUERY_STRING} !vbseourl=
RewriteCond %{REQUEST_URI} !(admineu/|modmsx/|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} !^(admineu|modmsx|clientscript|cpstyles|images)/
RewriteRule ^(.+)$ vbseo.php?vbseourl=$1 [L,QSA]
</Directory>

<Directory /home/msxorg/public_html/forum/tags>
Options +FollowSymLinks
RewriteEngine On
RewriteRule ^(.+)/([0-9]+)/$ index.php?tag=$1&page=$2 [NC,QSA,L]
RewriteRule ^(.+)/$ index.php?tag=$1 [NC,QSA,L]
</Directory>
Ok, we'd updated the related lines in the past because of some issues and now it's working with your advise.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4  
Old 11-25-2007, 05:49 PM
Member
 
Real Name: Gary Mullins
Join Date: Jan 2006
Location: Nashville, TN
Posts: 65
When I tried to use that same code you suggested for redirection it didn't work right in my case. This is what I put in my .htaccess file:

RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\.pimprig\.com
RewriteRule (.*) http://www.pcapex.com/$1 [L,R=301]

As you can see, I want to forward requests for pimprig.com to pcapex.com. I also have a bunch of subdomains I need to do this for as well. However, when I used those lines of code in my .htaccess file and try to access my site at any url, it displays a Red Hat Linux default test page?! Any other ideas?

EDIT // I uncommented the rewrite rules for the forum and that subdomain now works great. Anyone trying to go to a url at forums.pimprig.com are forwarded to the same URL at forums.pcapex.com. Why in the world won't it work for the root domain?
__________________
Admin, http://www.pcapex.com and http://www.gameapex.com

Last edited by GlitterKill; 11-25-2007 at 06:27 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5  
Old 11-25-2007, 06:07 PM
Keith Cohen's Avatar
vBSEO Staff
vBSEO Total Customer SupportBig Board Administrator
 
Real Name: Keith Cohen
Join Date: Jul 2005
Location: Raleigh, NC USA
Posts: 6,265
Blog Entries: 1
It should be:

RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\.pcapex\.com
RewriteRule (.*) http://www.pcapex.com/$1 [L,R=301]


That will redirect anything that is NOT www.pcapex.com to www.pcapex.com. The ! means NOT.
__________________
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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads

Thread Thread Starter Forum Replies Last Post
Sitemap links in footer redirecting Dave Hybrid Troubleshooting 5 05-30-2007 11:43 AM
vbseocp.php redirecting to itself? Boliga.dk Troubleshooting 1 03-17-2007 11:19 AM
Redirecting a Url cathiejones General Discussion 1 07-27-2006 06:41 PM
The page isn't redirecting properly creativepart Troubleshooting 3 07-21-2006 03:59 PM


All times are GMT -4. The time now is 12:31 PM.


Powered by vBulletin Version 3.8.0 Beta 3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.5 ©2008, Crawlability, Inc.