Forum Moderators: phranque

Message Too Old, No Replies

Redirection from specified referrer

         

dkin

3:37 am on Jan 3, 2006 (gmt 0)

10+ Year Member



I am having a big problem with google images, I am getting a few thousand uniques from them a month but the users only view the one page, then leave.

I would like to redirect any user coming from google images to my homepage via htaccess, this is what I have so far, now I am new at this so I know it is flawed because I have no idea what Im doing.

RewriteEngine on
RewriteCond %{HTTP_REFERER} ^images\.google\.com [NC]
RewriteRule \.html?$ /http://www.myurl.com [NC,L]

jdMorgan

3:54 am on Jan 3, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Actually, it looks pretty good. You'll need to provide the full referrer URL-head or un-anchor what you've got, and always use a trailing slash when you redirect or link to your home page -- This saves the server having to redirect slashless requests, and prevents all kinds of search engine 'bot confusion:

RewriteEngine on
RewriteCond %{HTTP_REFERER} [b]im[/b]ages\.google\.com [NC]
RewriteRule \.html?$ [b]ht[/b]tp://www.myurl.co[b]m/[/b] [NC,R=301,L]

Test this -- I think it'll work. If not, then you may need to add

RewriteCond %{REQUEST_URI} !^/index.html$

ahead of the rule, where index.html is the actual name of your home page.

Jim

cws3di

4:39 am on Jan 3, 2006 (gmt 0)

10+ Year Member




thank you, thank you, thank you

This is so much more useful than just using a break out of frames.

Many thanks to both of you!

dkin

4:43 am on Jan 3, 2006 (gmt 0)

10+ Year Member



lol uhhhh your welcome, glad my confusion could help, morgan as always job well done