Forum Moderators: phranque
I am new to this forum and I know very little about .htaccess.
I run a successful website, and as a result of that there are several other webmasters who "deep-link" or "leech" on to my pages giving the impression that they are part of their own websites. I have no wish to block these links but I would like to redirect them to the "index" page of my site so that the interested parties are aware that they have been forwarded to another site and can browse it if they wish. This would apply to all .html pages and various download pages in .doc and .pdf format.
I am told that this can be done using my .htaccess file. Can anybody please direct me to such a script or help me in any way?
Thanks in advance.
The basic idea is:
RewriteCond %{HTTP_REFERER} .
RewriteCond %{HTTP_REFERER} !^(www\.)?example\.com
RewriteRule ^deep_linked_page\.html$ http://www.example.com/category_page.html [R=301,L]
For more information, see the documents cited in our forum charter [webmasterworld.com] and the tutorials in the Apache forum section of the WebmasterWorld library [webmasterworld.com].
Jim