Forum Moderators: open
My .htaccess has
# Send a redirect from our old file to our new file
Redirect index.htm http://www.not-a-real-url.com/index.htm
and it's placed in the old sites root directory.
The redirect works fine, and I also tried what annej
said add <META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW"> , but I still get
--> Status: HTTP/1.1 302 Found
- from the tool found here http://www.searchengineworld.com/cgi-bin/servercheck.cgi
When wouldlike to get '301 Moved Permanently'
Any have any ideas?
Redirect index.htm h*tp://www.not-a-real-url.com/index.htm [R=301]
RedirectPermanent index.htm h*tp://www.not-a-real-url.com/index.htm
RedirectMatch (.*)$ h*tp://www.anotherserver.com$1 [L]
To redirect "index.html" to another domain using a 301-Moved Permanently redirect, use one of:
Redirect 301 /index.html http://www.example.com/index.html
Redirect permanent /index.html http://www.example.com/index.html
RedirectPermanent /index.html http://www.example.com/index.html
RedirectMatch 301 ^(.*)$ http://www.example.com$1
RedirectMatch permanent ^(.*)$ http://www.example.com$1
Redirect permanent / [example.com...]
This way e.g. /index.html gets redirected to [example.com...] /foo/bar.html gets redirected to [example.com...] etc.
TSchild's seems to be the best one as the others give me server errors.
Redirect permanent / [example.com...]
I now get:
Status: HTTP/1.1 301 Moved Permanently
and the old site is hosted on:
Server: Apache/1.3.27 (Unix) PHP/4.3.1 .
That sounds about right?
From what I've gleaned in the forums is that, google will now take '301 Moved Permanently' as a firm change of url and follow to the new url updating the index and removing the old url with the new one.
Correct me if am wrong.
Thx.
I've found that the 64.68 crawlers will not follow 301 redirects after no matter how many attempts.
Does this mean that the new-improved Google won't follow 301 redirects?
Here's my problem:
I have a dynamic index page with some random content - featured client, random testimonial...
Google has hit www.myverylongdomainname.com and myverylongdomainname.com and thinks they're two different pages. (because of the random content)
www.myverylongdomainname.com has 18 backlinks... one of which is my Yahoo category listing, another is one from the BBB on a PR7 page.
myverylongdomainname.com has 86 backlinks - this is the domain name we normally promote.
A few weeks ago, I read on here that I could do a 301 from www.myverylongdomainname.com to myverylongdomainname.com and that google would combine the backlinks.
However, after Esmerelda, Google has dropped www.myverylongdomainname.com, but myverylongdomainname.com is indexed, but not showing up in the SERPs for our main keyword. At all. We were in the top 10. I'm assuming that Google dropped www.myverylongdomainname.com but hasn't yet switched everything over to myverylongdomainname.com.
What should I do? Wait? Or try to come up with another plan?
I thought about changing my PHP code so googlebot didn't get the randomly generated content (which has caused confusion for her). Would this be considered cloaking? Googleguy?
Any help would be greatly appreciated.
That seems to be true:
[webmasterworld.com...]
Oh, well -- at least this makes my hosting problems with oldcompanyname.com not feel as important (site goes up, goes down, goes up, goes down -- argh). Maybe I'll be lucky and 64bot will only visit oldcompanyname.com during the down times and any dup content penalty will go away (pleasepleasepleaseplease).
64.68 will follow the 301 on robots.txt and sometimes the index page but, except very occasionally, nothing else. I kept a log of Googlebot's visits in early June for one week, it made 500+ requests, about 10 of them resulted in a 200 code. I've dropped from 500 odd pages indexed to 62 in fi.
As of Dominic I came off a whacking great two-month PRO penalty so that may have something to do with the bots reluctance to do what it's told.
The crawler function that we used to call Freshbot doesn't usually follow links or redirects, it only looks at URLs it knows about for fresh content. The crawler function we used to call Deepbot follows links and redirects.
If you want to have Google change the URL they use to list your pages, do a 301 redirect, not a 302. A 302 is defined [w3.org] as "Moved temporarily". If you use 302, Google rightly assumes the pages will return to the original URL and won't update their index. 301 is "Moved permanently", and that's what is needed here.
Jim
In my case anyway it rarely gets to the point of a 302 error because it requests virtually all pages, I am guessing, with www in the url. 90% or more of its requests end in 301, no further than that.
Also, although I have the 301 perm redirect in place using the .htaccess file, I was wondering if I need to add '301 PermanentRedirect' to the title of each page?
This is something I seen on some sites, which no longer have content.
although I have the 301 perm redirect in place using the .htaccess file, I was wondering if I need to add '301 PermanentRedirect' to the title of each page?
If you have the 301 set in your .htaccess correctly, you don't even need the old page, it will redirect before you hit it, and you won't even see that page's title.
I would be interested what you guys recommend for this. Most solutions seem to have a downside to me:
1. Not processing the querystring anymore means I end up letting the URLs default to their non-querystring version, and that in return means duplicate content all over the place.
2. Leaving the querystring functionality in place and deliberately returning a 301. That serves users who still come to the URLs, but I am afraid this could look highly "unnatural" to google to receive pages like that.
3. Returning a 301 together with some new "Location:". Again, this is somewhat "unnatural", as no one else, who isnt a SEO would bother with querystring-only redirects.
4. Like no 3. but I find it hardly possible in my situation to code the right "rules" to forward people to those URLs with equivalent content on them. I could forward ALL querystrings to the non-querystring version of each script. How would that look to googlebot?
4. Any other way of dealing with the issue, can not think of it?
Help appreciated, thanks.
For dynamic urls ie. shopping carts - I would use a .htaccess that has a 301 permanent redirect. Having the .htaccess in the /cart/ folder would be the case hypothetically speaking.
Where as the static pages, u might want to re-direct them individually in a second .htaccess file to the location where your pages reside.
For example
RedirectPermanent /page1.htm www.url.com/page1.htm
RedirectPermanent /page2.htm www.url.com/page2.htm
RedirectPermanent /page3.htm www.url.com/page3.htm
RedirectPermanent /page4.htm www.url.com/page4.htm
........
I'm a novice at this but I think I got the scenario right in ur situation.
In the second scenario if ur pages resite in the root am not sure if the 1st .htaccess is over-rules by the 2nd.
In order to redirect pages with query strings, you'll need to use mod_rewrite. This is further complicated by the fact that on most servers, query strings are not directly available to RewriteRule directives in the .htaccess context; you have to use RewriteCond. Here's an example:
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{QUERY_STRING} ^product=widget&model=123&color=blue$
RewriteRule ^cart.html$ http://www.mydomain.com/cart.html?product=widget&model=123[b]rev2[/b]&color=blue [R=301,L]
Now, if you are really worried about how this "looks" to search engines, you could use an internal (non-301) redirect, essentially substituting the new page for the old, but without any indication to the user or robot that this is happening. This would open you up to dup content issues. I don't agree that redirecting a query-string request is something that only an SEO would do - It's something that everyone with a query-based site that's been in service a long time might have to do. Anyway, the code to simply substitute a new page for an old one without telling anyone would look something like this:
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{QUERY_STRING} ^product=widget&model=123&color=blue$
RewriteRule ^cart.html$ /cart.html?product=widget&model=123rev2&color=blue [L]
HTH,
Jim
Cheers, for taking all this apache code down, but unfortunately I run IIS with ASP. I kinda checked and I think that IIS doesnt support forwarding querystring. At that point the querystring is not available yet. Of course, it also is nice how apache uses regExp pattern matching to forward, because what if the new URLs are NOT dynamic (~) anymore!?
I guess what I actually wanted to get at with this, how bad can it be to "condensate" URLs? We believe that this is what we need in our case, since we have been a bit too narrow with our keyword focus on certain pages.
Practically speaking that would result in several (dozens/hundreds of) URLs being "moved permanently" to ONE condensed URL. Any reason why this could be a bad thing for google to choke on I wonder? Probably not ... although it could be mistaken to be doorway usage perhaps, and/or it is not really what the inventors of the 301 wanted that function to be for either, is it? What do you think, guys?
> it is not really what the inventors of the 301 wanted that function to be
While your "hundreds of URLs" case is an extreme one, it is indeed what the inventors intended - a way to signal to the client that the requested URL should no longer be used, and that the supplied replacement URL should be used in its stead.
Doorway pages are typically set up with 302 redirects, because the intent is to fool the search engine into keeping the doorway URL and thinking that the page is worthwhile on its own. So yours is not a doorway situation.
I suggest you think of your users while deciding what is best. Ultimately, search engines will "like" what users like, and that is a good thing to consider.
Jim
The advantage is that you can 301 redirect specific pages. I prefer to use an absolute url (as in the example) each time. We've checked the browser headers, and we get a 301 each time:
<?php
header("HTTP/1.1 301");
header("Location: [my-destination-site.co.uk");...]
?>
As for moving a whole domain, that's for someone else to answer.
my site was in google for the home page only, i changed to a .co.uk and 301ed the .com, the .com was crawled and dropped instantly and the .co.uk was never picked up and crawled
i submitted manually and it was then crawled much later, but still not listed
I dont think the 301 redirect made google crawl the site, id put it down to the links i have recently created instead, if it was going to crawl the site it would have at least followed the redirect and come back later, which it didnt
why they are not following 301 redirects is beyond me completely, id love to hear a good explanation as to why.
That's exactly it. I find it very disturbing to learn that Google does not treat so basic information properly - doing the first part without doing the last part makes no sense. This is certainly not good. Restated for US-citizens (Mountain View, CA comes to mind): This sucks.
OTOH, G as well as the other SE's have always had a hard time with "www." and "non-www." versions, which is somewhat understandable, as it is perfectly okay to use "www.example.com" for one purpose and "example.com" for another. (as well as "xxx.example.com", "zzz.example.com", "xyz.example.com" etc.)
Regardless of this, however, a 301 has a distinct meaning that can and should not be interpreted in any other way than "the exact file you requested is now on this (other) location, and will remain there, so please use the new location whenever you want this (same) document."
/claus
[edited by: claus at 9:59 am (utc) on Aug. 8, 2003]
If Googlebot is heavily crawling one of my larger more popular sites and I want it to crawl a new page on a different site, I quickly turn on a 301 redirect to the new page, Googlebot follows it, indexes the page, then I turn the redirect off.
I found this thread where jdMorgan and andreasfriedrich both advises Shadow on using "mod_rewrite" in stead of using "Redirect", "RedirectPermanent" and the like.
The former method (rewrite) makes it possible to do a www/non-www redirect without putting the server into an endless loop which is nice. Jims post #4 (version 2) is the way to do it (just remove "www." from lines 2+3 if that is what you want)
LINK: [webmasterworld.com...]
/claus
Interesting what you are doing there. Are you saying you (conveniently) turn on 301 by adding that http header plus a new location header, but at the same time leave the page intact.
How important is it to change the actual html content on the page, e.g. a 301 error page? It would be nicer playing around with the 301 without having to change pages, as the browser is supposed to do the redirect anyway. Correct, or would the google "browser" differentiate?
It will not. Gbot will see exactly the same as any other browser, as the 301 redirect happens at the server level - that is before the page is returned to the browser.
You can have, say, "thispage.html" and 301-redirect it to "that-page.html" without moving or deleting "thispage" from the server - "that-page" will just be shown in stead.
Of course, if you do this, the proper way would be to make a 302 redirect (temporary) in stead of a 301 (permanent). Ideally Gbot would follow a 302 as well, but it seems from the above that this is not certain.
/claus
This one has always worked for me:
In file /.htaccess of domain olddomain.com,
RewriteEngine on
RewriteRule (.*) [newdomain.tld...] [R=301,QSA,L]
This will redirect all to the equivalent on the new domain, providing you keep the same directory structure.
The R=301 flag will ensure that the moved permanently header is returned to the caller, and the QSA (Query String Append) flag will rewrite your URI and append the original QUERY_STRING once rewritten.
Dan
PS: I have a few articles about URL rewriting on my site. They could help if you can read french. ;)