vBulletin SEO Forums

SEO

vBulletin Search Engine Optimization

Buy vBSEO Now! HACKER SAFE certified sites prevent over 99.9% of hacker crime.
ne nw
vBSEO Team: Hot or Not? Ready for Traffic Explosion? vBSEO 3.2.0 GOLD Has Landed Success with vBSEO = 600ore Web Visitors + $1400 in a Day! vBSEO Helps Forum Earn $100/day from Google AdSense Discover the Power of "Long Tail Search" Crawlability Inc. Files for SEO Technology Patent
se sw

http://www.domain 301 redirect to http://domain

This is a discussion on http://www.domain 301 redirect to http://domain within the General Discussion forums, part of the vBulletin SEO Discussion category; Hi guys, I have few queries I'd like to get your opinions on regarding the topic title: Would somebody mind ...

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

Enhancing 80 million pages.

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1  
Old 01-04-2006, 06:46 PM
Steve's Avatar
Member
 
Real Name: Steve P.
Join Date: Aug 2005
Posts: 35
http://www.domain 301 redirect to http://domain

Hi guys,

I have few queries I'd like to get your opinions on regarding the topic title:

Would somebody mind writing me up some rewrite rules that will transfer any users who are visiting my site from the URL http://www.domain.com to http://domain.com in a SEO safe manner? I don't know a whole lot about .htaccess and rewrite rules and all that businees, but if possible could you make sure that search engines won't have a problem following the redirect?

I say again: I'm not the brightest buton when it comes to .htaccess and that mumbo jumbo.

I apologise if this was posted in the wrong forum but I felt this was the closest available.

Hope someone can help me out, I'd be eternally grateful.

Steve
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2  
Old 01-04-2006, 07:00 PM
Member
 
Join Date: Aug 2005
Posts: 67
Re: http://www.domain 301 redirect to http://domain

This can be done via .htaccess (didn't test it, but it should work just fine):
Quote:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^www\.mydomain\.com [NC]
RewriteRule ^(.*) http://mydomain.com/$1 [L,R=301]
Replace mydomain with your real domain name.

That's it.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3  
Old 01-04-2006, 07:13 PM
Member
 
Join Date: Aug 2005
Posts: 67
Re: http://www.domain 301 redirect to http://domain

Sorry, bad code. It should be :

Code:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^www\.mydomain\.com$
RewriteRule ^(.*)$ http://mydomain.com/$1 [R=301,L]
It works!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4  
Old 01-06-2006, 06:57 AM
Steve's Avatar
Member
 
Real Name: Steve P.
Join Date: Aug 2005
Posts: 35
Re: http://www.domain 301 redirect to http://domain

Thanks very much SEO Report Worked a treat.

Just curious now, how woud I go about doing the exact opposite? By this I mean 301 redirecting http://domain to http://www.domain?

I'm starting to lean more towards keeping the www. part now, as I notice it's more common when linking to other sites. If someone could provide the code I would be eternally grateful (again). I have a good idea what to tweak in your code to create this effect but better to be safe then sorry, right?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5  
Old 01-06-2006, 07:46 AM
Member
 
Join Date: Aug 2005
Posts: 67
Re: http://www.domain 301 redirect to http://domain

You're welcome, Steve!

This code should 301 redirect non-www URLs to their www counterpart:

PHP Code:
RewriteEngine On

RewriteCond 
%{HTTP_HOST} !^www.domain.com [NC]
RewriteRule ^(.*) http://www.domain.com/$1 [L,R=301] 
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6  
Old 03-16-2008, 11:48 AM
Joe Ward's Avatar
vBSEO Staff
vBSEO Total Customer SupportvBSEO Documenter
 
Real Name: Joseph Ward
Join Date: Jun 2005
Location: Puerto Rico
Posts: 18,323
Blog Entries: 7
New resource:
[How to] Setup www.yourdomain.com or yourdomain.com (www vs. non-www) - With .htaccess 301 redirects
__________________
Joe Ward / 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.

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
301 redirect not working? googledave Troubleshooting 2 02-12-2006 08:37 PM
Best way to redirect my old forum to vb using 301 Bellinis General Discussion 11 10-29-2005 09:03 PM
Incorrect 301 redirect? SEO Report Bug Reporting 2 08-25-2005 12:14 AM
301 redirect original dynamic content mediax Bug Reporting 4 07-31-2005 02:22 PM


All times are GMT -4. The time now is 02:25 PM.


Powered by vBulletin Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0 ©2008, Crawlability, Inc.