Forum Moderators: phranque

Message Too Old, No Replies

Redirecting users from search engines

asking how to redirect users from offsite

         

Aegith

5:54 am on Apr 22, 2003 (gmt 0)

10+ Year Member



Hi, I was wondering something - Is it possible, through .htaccess or other method, to send viewers from offsite to your main index page, regardless of what page they were linked to? Thanks for your help.

markusf

6:22 am on Apr 22, 2003 (gmt 0)

10+ Year Member



detect the HTTP_REFERER

universalis

2:58 pm on Apr 22, 2003 (gmt 0)

10+ Year Member



You can do this with javascript - however, you can't be sure that the http_referer is available - for example, I use Norton Internet Security, which masks the referer, meaning that if I were attempting to surf your site, every link I clicked would throw me straight back to your index page. Result - I'd go elsewhere, thinking your site was broken.

Even if you were able to reliably detect the referer, try this scenario: I search for, say, a product in Google, and a page from your site came up as a result. However, rather than displaying the page with the information I want, you drag me away to your front door and make me try and find the information again. Faced with this, again I would go elsewhere, and you would lose a potential customer.

You can technically do what you were looking for, but it is a very, very bad idea in terms of usability. Do this, and you are putting a massive barrier between the user and the information they want! Remember, every page is a front page, so make sure you have good content as well as a menu and a simple link back to your index page.

markusf

4:42 pm on Apr 22, 2003 (gmt 0)

10+ Year Member



Yes i couldn't agree more...

I suppose if someone comes to your site searching for "soap" You could detect the search string soap and display to the user 10 listings. But if they had searched for soap in the first place, and they clicked on "blue soap" they probably want to buy blue soap...

Aegith

8:00 pm on Apr 22, 2003 (gmt 0)

10+ Year Member



I use frames. all I need to do is redirect people from offsite to my main page.

jdMorgan

8:22 pm on Apr 22, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hmmm...

A relatively common solution:


<script type="text/JavaScript" language="JavaScript1.1">
// Escape from any referring site's frame, but enable one-click "Back".
if (parent.frames.length > 0) top.location.replace(document.location);
</script>
<noscript>
<center>
<p><font face="Arial,Helvetica">If you've come here from another site, <a href="mainframe.html">click here</a> to restore the site navigation frame.</font></p>
</center>
</noscript>

Jim

brummie

8:32 pm on Apr 22, 2003 (gmt 0)

10+ Year Member



I think it's a bad idea to redirect to the same domain using .htaccess, as you will probably get a loop effect and over work your server.

{HTTP_REFERER} is probably not the best route.