Forum Moderators: phranque

Message Too Old, No Replies

Rewrite rule to force 404 error

         

Hissingsid

2:51 pm on Feb 11, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi,

I have a problem. Google has indexed a redirecting URL which points to my root page. I would like to have a rewrite rule which will force an error so that Googlebot realises that it is dead.

At the end of the URL is a query string like this;

?searchenginename

How could I rewrite this so that it sends a 404. Or is there a better error to send back like forbiden for example?

Any help would be very gratefully received.

Many thanks in advance

Sid

Hissingsid

11:32 am on Feb 12, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi,

I've figured it for myself.

RewriteEngine on
Options +FollowSymlinks
RewriteBase /
RewriteCond %{QUERY_STRING}  searchenginename
RewriteRule ^$ /product1.html [L]

Since product1.html does not exist this returns a 404 so Googlebot should eventually get the idea and remove the URL.

I hope that this may help others.

Best wishes

Sid

dcrombie

10:44 am on Feb 13, 2004 (gmt 0)



Would it be better to use [R=301,L] to indicate that the page has "Moved Permanently"?

Hissingsid

10:50 am on Feb 13, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Would it be better to use [R=301,L] to indicate that the page has "Moved Permanently"?

Wouldn't that just keep the link in the index. My objective in this is to get the erroneous pseudopage removed from Google's index.

I'll sticky you the actual search so you can see what I'm trying to do.

Best wishes

Sid

dcrombie

11:08 am on Feb 13, 2004 (gmt 0)



There are people on this forum who know more about this than I do, but I think issuing a 301 is a signal to Google to remove the old link and index the new one. You might have to wait for the next 'deep index' of your site which could be days or weeks.

jdMorgan

7:26 pm on Feb 13, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



301-Moved Permanently tells the user-agent to discard the old URL. 302-Found, a.k.a. 302-Moved Temporarily tells it to keep using the old URL.

Jim

claus

7:37 pm on Feb 13, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



>> Since product1.html does not exist this returns a 404 so

Nevertheless you should create a page called "product1.html" and place this tag in the "<head>" section:

<meta name="robots" value="noindex,nofollow">

You can let the content of the page be blank or whatever - the tag is the only thing that is really needed.

Link: [google.com...]

I had a very similar case [webmasterworld.com] in november and got the URL error removed within 12 hours using the express remove procedure outlined on the above page.

Hissingsid

9:31 pm on Feb 13, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi Claus,

Thanks very much for your input. Very good advice as always.

Best wishes

Sid