vBulletin Search Engine Optimization
|
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 ...
| |||||||
|
#1
| ||||
| ||||
| 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 |
|
#2
| |||
| |||
| 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:
That's it. |
|
#3
| |||
| |||
| 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]
|
|
#4
| ||||
| ||||
| 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? |
|
#5
| |||
| |||
| 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: |
|
#6
| ||||
| ||||
|
New resource: [How to] Setup www.yourdomain.com or yourdomain.com (www vs. non-www) - With .htaccess 301 redirects
__________________ Joe Ward / Crawlability Inc. vBSEO Styles: Version 1.0 PRO For Everyone Version 2.0 For vBSEO Customers vBSEO 3.3.0 Gold Released with New "Virtual HTML Display" Feature Available for Download Now 6X Traffic - $1400 in One Day with vBSEO! Max Out Your SEO |
| Thread Tools | |
| |
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 |