Welcome to WebmasterWorld Guest from 107.20.75.142

Forum Moderators: Ocean10000 & incrediBILL & phranque

Message Too Old, No Replies

"www.yoursite.com" versus "yoursite.com" and redirects

does it help to rewrite all yoursite.com to www.yoursite.com

     
2:18 pm on May 7, 2003 (gmt 0)

Junior Member

10+ Year Member

joined:Nov 29, 2002
posts:82
votes: 0


I've got two related questions:

1. Does it help to redirect all yoursite.com to www.yoursite.com? I notice that webmasterworld does it.

2. What is the appropriate rewrite command in the .htaccess file to do this universally/generally across the site with only a single rewrite rule in .htaccess? I've searched webmasterworld for an answer to this but keep finding more complicated scenarios than I'm dealing with. I don't want to redirect from an old site to a new site. I also don't want to redirect just a particular directory or file. I want to redirect all calls to site.com* to www.site.com*

Thanks for any help.

2:05 am on May 8, 2003 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Sept 21, 1999
posts:2141
votes: 0


Does it help to redirect all yoursite.com to www.yoursite.com?
Does it help WHAT? ;)

There is evidence that Google splits the page rank for a site that has incoming links pointing to both www.yoursite.com and yoursite.com which is why I use this type redirect on my sites.

AFAIK, you'll need at least two lines of code to implement this redirect. Also, it would be prudent to become a little familiar with .htaccess and mod_rewrite before trying this, there can be some "gotchas." This post [webmasterworld.com] will introduce you to them. The code you're looking for is already on the board in several places but perhaps someone will post it again for you.

3:51 am on May 8, 2003 (gmt 0)

Junior Member

10+ Year Member

joined:Nov 29, 2002
posts:82
votes: 0


Dave,
I've spent a lot of time with .htaccess, so becoming familiar is not an issue. I'm just having the hardest time finding or thinking of a solution to a general redirect. I've searched WebmasterWorld extensively and find much on .htaccess and redirects but none that give specific examples of a universal redirect from site.com* to www.site.com* .
4:09 am on May 8, 2003 (gmt 0)

Moderator

WebmasterWorld Administrator buckworks is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Dec 9, 2001
posts:5624
votes: 26


I do the reverse ... I redirect www.mysite.com to mysite.com ... but the same thought processes apply.

If your preferred form is the only URL that ever appears in your address bar, that improves the likelihood that other sites will link to you that way. It is A Good Thing to have your link pop focused on one form or the other, rather than split between the www. and non-www. versions. I don't think it matters which one you use as long your link pop is as consistent as possible.

2:03 pm on May 8, 2003 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Sept 21, 1999
posts:2141
votes: 0


Here's one solution:

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

We try to avoid redundant posts to keep WebmasterWorld as useful as possible but it's tough to search it all...
5:20 pm on May 8, 2003 (gmt 0)

Junior Member

10+ Year Member

joined:Nov 29, 2002
posts:82
votes: 0


Thanks a whole lot. That worked on a first try.

BTW, as webmasterworld gets filled with more and more content (much of which is noise), have there been any plans to manually pull content out and highlight it somewhere on the site?

I've been using this site for a little over 1 year now, and have found it increasingly more difficult to find the information I need as the membership base and posting has gone up.

Just a thought.

 

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members