Marco
Marco

Reputation: 2737

how to redirect using HTTP_REFERER on htaccess

I did my research, but I'm still not able to make this work...

All i'm trying to do is to redirect all incoming traffic from a specific link on another webpage to a page of my choosing...

Options +FollowSymLinks
RewriteCond %{HTTP_REFERER} http://theotherwebsite.qc.ca/ [NC]
RewriteRule ^http://www.cnn.com$ [L]

Why it doesn't work?

Upvotes: 0

Views: 1816

Answers (1)

Niko Sams
Niko Sams

Reputation: 4414

  1. RewriteCond needs a regular expression

    RewriteCond %{HTTP_REFERER} ^http://theotherwebsite\.qc\.ca/ [NC]

  2. RewriteRule needs a regular expression what is should redirect and the target

    RewriteRule ^(.*) http://www.cnn.com [L]

Upvotes: 1

Related Questions