문제

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?

도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top