by spaz » 08 Mar 2009 08:46
Yes it would and I thought about that after I had already posted. The below is more detailed.
* Any saved Favorite, Bookmark or any link out in cyber-land,
with www or non www,
(example):
* www
http://www.myproduct.com/releases/myproduct_1.0.zip
http://www.myproduct.com/releases/myproduct_1.10.zip
* non www
http://myproduct.com/releases/myproduct_1.0.zip
http://myproduct.com/releases/myproduct_1.10.zip
will be forced to start from your home page.
Even your newest release link "if not clicked on from" your home page will not work.
# This also works great for curbing Hot-Linking, just change to:
(examples)
RewriteCond %{REQUEST_URI} ^/image-folder.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://(www\.)?myproduct.com/.*$ [NC]
RewriteRule .* - [F,L]
RewriteCond %{REQUEST_URI} ^/any-file-folder.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://(www\.)?myproduct.com/.*$ [NC]
RewriteRule .* - [F,L]
#####################################################################
#
This should meet your need.
This all is assuming, that Mod Rewrite is enabled on your server, (most do).
The below will force any requests to "anything" in the releases folder be made from your home page link.
#
* Change domain name where needed.
#####################################################################
<IfModule mod_rewrite.c>
Options +FollowSymlinks
RewriteEngine on
RewriteBase /
#
# MaxRedirects
RewriteOptions MaxRedirects=3
#
# Loop Stopper
RewriteCond %{ENV:REDIRECT_STATUS} ^.
RewriteRule ^ - [L]
#
# Releases
RewriteCond %{REQUEST_URI} ^/releases.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://(www\.)?myproduct.com/.*$ [NC]
RewriteRule ^(.*)$ http://www.myproduct.com/ [R=301,L]
#
</IfModule>
#
# The below can be deleted if you have it already
# Htaccess - Htpasswd Protection
<FilesMatch "^.*\.([Hh][Tt][Aa]|[Hh][Tt][Pp])">
order allow,deny
deny from all
satisfy all
</FilesMatch>
#
Options All -Indexes
IndexIgnore */*
))))))))))))))))))))))))))))))))))))))))))))))))))))))))))
* Failed to mention that if not allowed to crawl the releases folder:: bots, scrapers will be directed to home page as well.
* I am providing details that may not be necessary for those who have more understanding,
* But for those that are learning, like myself, I hope that it will help them grasp this stuff a little easier.
# Releases
RewriteCond %{REQUEST_URI} ^/releases.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://(www\.)?myproduct.com/.*$ [NC]
* Example for allowance if name is any-where within the User Agent field * Remember user agent can be spoofed
RewriteCond %{HTTP_USER_AGENT !GoogleBot|Slurp|Teoma|bad-bot|content-scraper [NC]
RewriteRule ^(.*)$ http://www.myproduct.com/ [R=301,L]
Hope everything is beneficial, Spaz
Last edited by
spaz on 08 Mar 2009 16:43, edited 1 time in total.