Reputation: 477
I have my images for every item stored in seperate folders, like this.
http://domain.com/upload/phones/2262/1.jpg
Now I want to redirect user using .htaccess if referrer is google to
http://domain.com/az/phones/item/2262/
Can anyony help me in this?
Upvotes: 1
Views: 56
Reputation: 784948
put this code in your DOCUMENT_ROOT/.htaccess
file:
RewriteEngine On
RewriteCond %{HTTP_REFERER} google [NC]
RewriteRule ^upload/([^/]+)/([0-9]+)/[^.]+\.jpe?g$ /az/$1/item/$2/ [L,NC,R]
Just keep in mind that HTTP_REFERER
header can be manipulated.
Upvotes: 1