apache - Need .htaccess rewrite by referrer -


i have images every item stored in seperate folders, this.

http://domain.com/upload/phones/2262/1.jpg

now want redirect user using .htaccess if referrer google

http://domain.com/az/phones/item/2262/

can anyony me in this?

put code in 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 http_referer header can manipulated.


Comments

Popular posts from this blog

python - Subclassed QStyledItemDelegate ignores Stylesheet -

java - HttpClient 3.1 Connection pooling vs HttpClient 4.3.2 -

SQL: Divide the sum of values in one table with the count of rows in another -