Forum Moderators: phranque

Message Too Old, No Replies

Yahoo has indexed odd url and 301 rewrite won't work

301 redirecting an incorrect url

         

bouncybunny

1:37 pm on Feb 11, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



For reasons best known to itself, Yahoo has somehow managed to index the following url to my site. I'm guessing it was from a CMS that I used to run.

http://www.example.com/index.php?action=results&event_ident=7

The above url simply shows my home page in the browser, but obviously I would rather that Yahoo indexed http://www.example.com/.

I have tried my usual method of redirecting this but it doesn't work

Redirect 301 /index.php?action=results&event_ident=7 http://www.example.com/

Anyone got any suggestions?

MadeWillis

2:33 pm on Feb 11, 2008 (gmt 0)

10+ Year Member



I've known Yahoo to index weird URLs. They even index some of my paid Google ads, but this has been on the decline.

jdMorgan

4:23 pm on Feb 11, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Since the query string is not part of the URL, but rather, data attached to the URL to be passed to the resource at that URL, your Redirect prefix will never match.

Use mod_rewrite, with a RewriteCond pattern to test the query string, and a RewriteRule pattern to test only the URL-path.

Jim

bouncybunny

7:54 pm on Feb 11, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Use mod_rewrite, with a RewriteCond pattern to test the query string, and a RewriteRule pattern to test only the URL-path.

Thanks Jim, although that's way over my head to be honest.

walrus

9:58 pm on Feb 11, 2008 (gmt 0)

10+ Year Member



Thanks Jim, although that's way over my head to be honest.

hehe....you're not alone there.

g1smd

11:14 pm on Feb 11, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Use {QUERY_STRING} in the RewriteCond line and test for that existing.

Then use a RewriteRule that strips the query string from the URL.

There's several examples of that in recent weeks. Try some sample code and post what you have got.

bouncybunny

4:22 am on Feb 12, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Sorry guys, I don't even know where to start with that.

wilderness

5:15 am on Feb 12, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Sorry guys, I don't even know where to start with that.

Jim's been using this example lately.

RewriteEngine On
RewriteRule ^foo\.html$ [webmasterworld.com...] [R=301,L]

bouncybunny

6:58 am on Feb 12, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I really really wish I could say that helped, but I'm clearly way out of my depth here.

Thanks for trying guys. I'll just have to let Yahoo get on with it.

Marcia

12:34 am on Feb 13, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member




System: The following message was spliced on to this thread from: http://www.webmasterworld.com/apache/3573415.htm [webmasterworld.com] by jdmorgan - 6:43 pm on Feb. 12, 2008 <small>(CDT -6)</small>

bouncybunny:

I really really wish I could say that helped, but I'm clearly way out of my depth here.

Well, naturally. :)

Don't feel bad. You'd have to know enough about writing mod_rewrite regular expressions to have half a clue of how to even do a site search to find the first piece of the puzzle, which would be the first step to finding a solution.

Clue 1: It's got something to do with query strings.

Clue 2: ______________________

[edited by: jdMorgan at 12:44 am (utc) on Feb. 13, 2008]
[edit reason] Spliced thread [/edit]

Marcia

12:50 am on Feb 13, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I can completely sympathize. I've had a ton of wierd stuff indexed by Yahoo for a couple of years and haven't been able to find a solution yet. In fact, it took the /widgets/ subdirectory right out of the index. They usually don't index ith the final forward slash on subdirectories, only once in a while they do

They have

/widgets?D=A
/widgets?M=A
/widgets?D=D

/gadgets?N=D
/gadgets/?N=D

The bad part is that the /realdirectory/ gets knocked out of the index. IMHO it's some kind of scraping/hijacking issue because it's on a couple of sections that *were* well trafficked for some seasonal stuff.

It also happens with wiseguys who log-spam using
www.example.com/?mycrummyspammingsite.html
to let you know they visited.

Marcia

10:39 pm on Feb 15, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I posted some code I tried but it didn't work, and then got the working solution here:

[webmasterworld.com...]

Works fine.

bouncybunny

9:36 am on Feb 23, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Thanks Marcia

I am slowly working through that thread and some others. It's getting it to do exactly what you want and not do anything scary that is always a worry.