Forum Moderators: phranque
Here's the snippet from my httpd.conf. I've commented it out since it doesn't work
# check for who the referer is and if they are coming to the main site from the referer page, send to another specific page
# still buggy, needs work
# RewriteMap deflector txt:/var/www/website/.htdeflector
# RewriteCond %{HTTP_REFERER}!=""
# RewriteCond %{REDIRECT_SCRIPT_URI}!="/"
# RewriteCond ${SCRIPT_URL} ^[^a-zA-Z.]$
# RewriteCond ${deflector:%{HTTP_REFERER}¦NOT-FOUND}!=NOT-FOUND
# RewriteRule ^.* ${deflector:%{HTTP_REFERER}}? [R=301,L]
and of course the .htdeflector file would be something like
[somereferingsite1.com...] /pageforsite1.html
[somereferingsite2.com...] /pageforsite2.html
however, when i use this, it usually ends up in an endless loopl since, even after the redirect, it still brings up the referer as the original refering page.
Thanks
Wing Lian
RewriteMap deflector txt:/var/www/website/.htdeflector
RewriteCond %{HTTP_REFERER} .
[b]RewriteCond %{REQUEST_URI} [i][/i]!^/pageforsite1\.html$
RewriteCond %{REQUEST_URI} [i][/i]!^/pageforsite2\.html$[/b]
RewriteCond %{REDIRECT_SCRIPT_URI} !^/$
#RewriteCond ${SCRIPT_URL} ^[^a-zA-Z.]$
RewriteCond ${deflector:%{HTTP_REFERER}¦NOT-FOUND} !^NOT-FOUND$
RewriteRule ^.* ${deflector:%{HTTP_REFERER}}? [R=301,L]
Jim