You are not logged in.
Pages: 1
Hello,
I’ve got a question about external Links, especially those from Search Engines: If a Visitor comes to my Site due to an external Link, I want him/her always beeing redirected to my Startpage. Any Ideas how to implement this with Textpattern/Html?
Offline
kuechi,
you can probably accomplish this via the .htaccess file. I’m not sure how to do it off the top of my head, but I would research RewriteCond and RewriteRule
UPDATE
Found this sample code out there:
RewriteRule on
RewriteCond %{HTTP_REFERER} !^.*sitename\.com.* [NC]
RewriteRule /* http://www.sitename.com/ [R,L]
I highly suggest researching all aspects of RewriteCond and RewriteRule before implementing this sample code
Last edited by variaas (2006-11-06 04:13:00)
Offline
There’s probably a PHP script out there, but I would strong advise against using it. Search engine visitors search to find a page, not to be redirected to the homepage and have to hunt for the page they needed.
Offline
Found this sample code out there:
RewriteRule on
RewriteCond %{HTTP_REFERER} !^.sitename\.com. [NC]
RewriteRule /* http://www.sitename.com/ [R,L]
I tried this now:
RewriteEngine On
RewriteCond %{HTTP_REFERER} !^http://www.kuechelmann.net* [NC]
RewriteRule /* http://www.kuechelmann.net/index.php [R,L]
and theoretically your idea is an good try. But now i always get a “Infinite Redirection Error”. I’ve also tried HTTP_HOST with the same Result :( The Apache Server Doku is a little bit hard to understand, so if you have any further suggetions it would rahter help me.
Tnx to now—
Offline
you might want to check the apache documentation here for 1.3
aswell there is an ok tutorial on hotlinking prevention via mod_rewrite here
Last edited by jayrope (2006-11-06 10:07:39)
jayrope
Offline
na kuechi ich hab da was fuer dich:
here’s some typical code for denying hotlinking on media files
RewriteCond %{HTTP_REFERER} ^http(s)?://(www\.)?singingfish.com/.*$ [NC,OR]
RewriteRule .*\.(mp3|jpg|gif|png|avi|mpg|wmv)$ / ®
like i said above there’s more & detailed info with the apaches 1.3 mod_rewrite docs
enjoy
jayrope
Offline
Pages: 1