Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2006-11-06 02:30:18

kuechi
New Member
From: Mönchengladbach
Registered: 2006-11-06
Posts: 3
Website

Redirecting to my Homepage

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

#2 2006-11-06 03:46:26

variaas
Plugin Author
From: Chicago
Registered: 2005-01-16
Posts: 402
Website

Re: Redirecting to my Homepage

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

#3 2006-11-06 03:51:06

jm
Plugin Author
From: Missoula, MT
Registered: 2005-11-27
Posts: 1,746
Website

Re: Redirecting to my Homepage

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

#4 2006-11-06 05:58:25

kuechi
New Member
From: Mönchengladbach
Registered: 2006-11-06
Posts: 3
Website

Re: Redirecting to my Homepage

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

#5 2006-11-06 09:57:48

jayrope
Plugin Author
From: Berlin
Registered: 2006-07-06
Posts: 687
Website Mastodon

Re: Redirecting to my Homepage

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)


A hole turned upside down is a dome, when there’s also gravity.

Offline

#6 2006-11-06 21:39:03

jayrope
Plugin Author
From: Berlin
Registered: 2006-07-06
Posts: 687
Website Mastodon

Re: Redirecting to my Homepage

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


A hole turned upside down is a dome, when there’s also gravity.

Offline

Board footer

Powered by FluxBB