Forum Moderators: phranque
This worx fine to for PHP,Mp3,jpg....etc..
but i want to redict:
if some links to my site www.example.org/HOME/ then he will redicted to www.example.com/redict.html
but on my sites..example.org home.example.org , users should not be redicted..
[edited by: jdMorgan at 5:05 pm (utc) on Mar. 1, 2004]
[edit reason] Examplified, fixed spacing [/edit]
Welcome to WebmasterWorld [webmasterworld.com]!
First, let's simplify what's there:
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://home.example.org/ [NC]
RewriteCond %{HTTP_REFERER} !^http://(www\.)?example.org/ [NC]
RewriteRule \.(mp3¦php¦jpg)$ http://www.example.org/redict.html [NC,R=301,L]
This worx fine to for PHP,Mp3,jpg....etc..
but i want to redict:
if some links to my site www.example.org/HOME/ then he will redicted to www.example.com/redict.html
but on my sites..example.org home.example.org , users should not be redicted..
To accomplish that, add the following:
RewriteCond %{HTTP_HOST} ^www\.example\.org
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://home\.example\.org/ [NC]
RewriteCond %{HTTP_REFERER} !^http://(www\.)?example\.org/ [NC]
RewriteRule ^HOME http://www.example.com/redict.html [NC,R=301,L]
Jim