Forum Moderators: coopster & phranque

Message Too Old, No Replies

.htaccess

mod_rewrite - can't get it to work correctly

         

jwsmith2222

1:53 am on Apr 16, 2002 (gmt 0)



I have a site and I want the .htaccess to check the referer is the referer = x then let them in, otherwise transfer them to y. Here is what I have, i will use www.yahoo.com in exchange for my server.

RewriteEngine on
RewriteCond %{HTTP_REFERER} !^http://plugin.yahoo.com/.*$ [NC] <-- Check to see if the referer is plugin.yahoo.com if it is, goto RewriteRule

RewriteRule [yahoo.com...] [R,L]

but it doesn't seem to work...any help, and then have it send them somewhere else like www.altavista.com if it isn't = to plugin.yahoo.com

Thanx in advance.

James

paynt

2:16 am on Apr 17, 2002 (gmt 0)



Hi jwsmith2222 and welcome to Webmaster World.

I'm doing drive-by bumps to what I feel are interesting questions in need of interesting answers. As a technical dunce I have no answer but I bet someone who sees this will.

sugarkane

4:09 pm on Apr 22, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



If I understand what you're trying to do here, you just want to redirect to an external site if the referer isn't plugin.yahoo.com?

RewriteEngine on
RewriteCond %{HTTP_REFERER} !^plugin.yahoo.com/.*$ [NC]
RewriteRule ^.*$ [altavista.com...]

should work... although I freely admit I'm no authority on mod_rewrite ;)