Forum Moderators: phranque
# Enable mod_rewrite
Options +FollowSymlinks
RewriteEngine on
#
# Internally rewrite visitors referred by EXTERNAL-DOMAIN.COM to PAGE1.html page
RewriteCond %{HTTP_REFERER} EXTERNAL-DOMAIN\.com
RewriteCond %{REQUEST_URI} !^/PAGE1\.html$
RewriteRule .* /PAGE1.html [L]
Ok, so based on this rewrite rule, WHY when I visit a directory on my site that does exist (Example: www.mysite.com/directory1/), I always get redirected to www.mysite.com/PAGE1.html? Just so you know, the directory that I am requesting does not have an index page setup intentionally.
I don't have a clue as to why this is happening... I would have thought that since there is no index in the directory that is being requested, my site would give a 403 error? I don't want visitors being redirected to PAGE1.html unless they are coming from a *particular* domain as I have it setup to do above.
Thank-you so much!
Disable this rule and add "-Indexes" to your Options directive. Then request that non-existent directory index URL again. What ErrorDocument does the server serve as a result?
Be sure to completely-flush your browser cache before starting a new round of testing, and after changing the code in any way.
Jim
Options +FollowSymlinks -Indexes
However, it still does the same thing. I don't have any other rewrite rules that have anything to do with PAGE1.html. (I only have 2 other rewrite rules in my .htaccess) I also don't have any other .htaccess files on my server.
Thanks!