Redirecting Google/Yahoo cache links

Discuss practical ways rearrange URLs using mod_rewrite.

Redirecting Google/Yahoo cache links

Postby whitenoise » Thu Sep 18, 2008 1:31 pm

Hello everyone,

I am trying to add some code in my .htaccess to redirect any cached versions of my pages to the actual pages. My site has undergone some quite big changes recently and my error logs are getting clogged with requests for files that no longer exist as these are google or yahoo cache links.

I mananged to find some information here:

#Google Cache
RewriteCond %{HTTP_REFERER} search\?q=cache: [NC]
#MSN Cache
RewriteCond %{HTTP_REFERER} cache\.aspx\?q [NC]
#Yahoo Cache
RewriteCond %{HTTP_REFERER} cache\?ei [NC]

But couldn't quite get to a point where these requests where redirected to the non-cached version of the page they were asking for.

Can anyone here help?

Many Thanks!
Posts: 9
Joined: Fri Jun 27, 2008 2:47 am

Postby richardk » Fri Sep 19, 2008 7:26 am

What are the URLs like? (Working and not working.)
What is the error in your error log like?
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am

Return to Friendly URLs with Mod_Rewrite

Who is online

Users browsing this forum: No registered users and 8 guests