Forum Moderators: phranque

Message Too Old, No Replies

htaccess to remove tracking URL on index page

         

DTIAnalyst

12:26 am on Nov 26, 2007 (gmt 0)

10+ Year Member



Here it is... My server went down and while it did the host used a redirect. Googlebot just so happen to visit my site during this down time. Now they have dropped my index page and all my ranking from the index. On a search for my domains name I can see http://www.example.com/?redirectfromhost=your-server-is-down. I have tried everything I can think of to redirect http://www.example.com/?redirectfromhost=your-server-is-down to http://www.example.com/. Nothing seems to work.

If anyone can help me figure this thing out [I'd appreciate it].

[edited by: jdMorgan at 1:08 am (utc) on Nov. 26, 2007]
[edit reason] Edited to comport with TOS [/edit]

phranque

1:05 am on Nov 26, 2007 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



welcome to WebmasterWorld [webmasterworld.com], DTIAnalyst!

try this:
RewriteCond %{QUERY_STRING} ^redirectfromhost=your-server-is-down$
RewriteRule ^.*$ http://www.example.com/ [R=301,L]

[edited by: jdMorgan at 1:09 am (utc) on Nov. 26, 2007]
[edit reason] cleaned-up original query string, examplified [/edit]

jdMorgan

1:14 am on Nov 26, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You'll need to add the "?" token to the end of the substitution URL to clear the query string. Also, use a RewriteRule pattern of "^$" if this rule is to apply only to the site's index page:

RewriteCond %{QUERY_STRING} ^redirectfromhost=your-server-is-down$
RewriteRule [b]^$[/b] http://www.example.com[b]/?[/b] [R=301,L]

Jim

DTIAnalyst

2:24 pm on Nov 26, 2007 (gmt 0)

10+ Year Member



This worked like a charm. I can't thank you enough...

Hopefully, Google will now see my index page is still there, re-index the site and return my rankings. Fingers crossed...