drakkarnoir
asked on
mod_rewrite questions
I wanted to do the two following things with mod_rewrite (or any other mod if possible):
1) Prevent hotlinking
2) Resolve relative URL's (such as /articles/9/ would actually read articles.php?ID=9)
Thanks in advance.
1) Prevent hotlinking
2) Resolve relative URL's (such as /articles/9/ would actually read articles.php?ID=9)
Thanks in advance.
Hi,
the second point could be done like this
RewriteEngine On
RewriteRule ^(.+)/$ /$1 ## remove trailing slash
RewriteRule ^/articles/(.*)$ /article.php?id=$1 [R,L] ## redirect to the URL and stop the processing
david
the second point could be done like this
RewriteEngine On
RewriteRule ^(.+)/$ /$1 ## remove trailing slash
RewriteRule ^/articles/(.*)$ /article.php?id=$1 [R,L] ## redirect to the URL and stop the processing
david
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER