View Full Version : 302 Redirection On Our Servers?
thomas
05-30-2005, 05:08 PM
I was just reading about google and how it has trouble handling 302 dedirecting, and how we should be using 301 redirect.
Here is my question:
on our servers, how is the www / non-www version of our url handled?
Also, when we add domain pointers, how are they handled?
Is there any "302 redirection" on our servers with either of the above cases?
Thanks,
Not sure I understand your question ... can you elaborate?
http://www.webmasterworld.com/forum30/28742-1-15.htm
thomas
05-31-2005, 07:57 AM
:) Thanks Joe,
that's the page I came from to post my question. I guess I was trying to avoid reading all these threads - it could take days.
I guess I don't understand what happens when we redirect on our server. I use DA to redirect two other domains to my main domain. Beyond the DA wysiwyg I don't understand much. Does the server use one of these 301s or 302s to make the redirection work?
How does the whole www or non-www thing work? any 301s or 2s involved there?
I don't really need to know all the details of the server inner workings, I just need to know if 301s or 302s are involved.
Thomás
thomas
05-31-2005, 11:19 AM
I did some more reading on this.
here is a quote from the other forum Joe referred:
"In a nutshell, you need server code that redirects example.com requests to www.example.com or vice versa. Otherwise, if (for example) your site is www.example.com and somebody just links to example.com, Google may index pages within your site twice: once at www.example.com, and again at example.com. This may lead to "duplicate content" problems, and it may also dilute incoming PageRank.
The way to implement this on an Apache server (the most common type of Web server) is with a 301 redirect in your .htaccess file."
--> So a more direct question would be, does our server redirect the non-www version of our domains to one that includes the www with a 301 re-direct in the .htacess file?
If not, how can I do it myself?
Thanks again,
Thomás
Originally posted by thomas@May 31 2005, 09:19 AM
So a more direct question would be, does our server redirect the non-www version of our domains to one that includes the www with a 301 re-direct in the .htacess file?
Quoted post
This happens by default in Apache. I don't know whether it's a 301 redirect, but it works. :)
hoopty
06-01-2005, 06:10 PM
This is how I do it. Put this in your root .htaccess :
RewriteEngine On
RewriteCond %{HTTP_HOST} ^mydomain\.com [NC]
RewriteRule ^(.*)$ http://www.mydomain.com/$1 [L,R=301]
Replace "mydomain" with your domain name and it should work.
Jesse
thomas
06-02-2005, 09:53 AM
ok, now I did some more reading and I feel a bit more educated.
Apparently, apache uses some sort of redirect code in the .htaccess to redirect from www to non-www version. Both 302 and 301 redirect would do the trick, except google has a glitch and considers a 302 redirect to be "black hat" tactic so it penalizes a site that uses it.
Now, if you don't aspire to any income from your site you don't have to worry about it. But if you do want to be found on the internet you absolutely have to rank in search engines. A small detail like your host using 302 redirects can destroy all your hard work without you knowing it.
So here is the question again: What kind of redirect does or server use to handle www or non-www versions of a domain?
hoopty, thanks for your answer.
Are suggesting that I can create my own .htaccess file? and use this code? Will this override the server's way of doing it? I don't seem to be able to find a .htaccess file on my server.
Thomás
hoopty
06-02-2005, 03:56 PM
Thomás,
You can make your own if there is not one present already. Just put the code in any old text file using notepad or whatever. I don't think you'll be able to name it correctly in windows, but ftp it to your site and rename it there. It will be just ".htaccess". Make sure it is in the root directory of the domain you are using.
The code I posted is a 301 redirect and should handle what you are looking to do. It will also work for subdomains as well. Good luck.
Jesse
thomas
06-02-2005, 10:21 PM
Thank you for your help Jesse,
I will give it a try it over the weekend.
Cheers,
Thomás
thomas
06-03-2005, 06:37 PM
Thanks Jesse,
I created the .htaccess and it works like a charm.
For those who are still wondering, the original question posted by me here contained a fatal error: The server does not redirect from a non-www url to the www-including url, it simply shows the right page.
Apparently google comes to index and sees two different sites (non-www and www) with identical content, but identical content will ban you from google any time, so perfectly good sites run the risk of being banned from the google index for serving duplicate content.
Using the .htaccess file with the code jesse posted above sends google (and all visitors) to the www.domain.tld even when they don't type the 'www' part. Hence google spider does not get confused.
At least that's what I understand so far.
Thomás
dbmasters
06-03-2005, 06:44 PM
It takes more than a simple www/non-www to get you banned from google...if that is your biggest concern, don't worry about it.
hoopty
06-05-2005, 01:14 AM
Originally posted by dbmasters@Jun 3 2005, 05:44 PM
It takes more than a simple www/non-www to get you banned from google...if that is your biggest concern, don't worry about it.
Quoted post
This is true. But I just find it better to avoid the non-www aspect when possible. Just my 2˘ though.
Jesse
Powered by vBulletin™ Version 4.0.3 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.