The wonders of mod_rewrite

home of a content challenger

The wonders of mod_rewrite

Sometimes I forget the wonders of the different modules Apache has. A friend of mine drew my attention to mod_rewrite. A very useful tool indeed. You can prevent people from steeling your content, or do other nice redirecting rules with it. Here is a nice example that illustrates how to redirect all incoming calls from one site to another (just put the lines in your .htaccess file):
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{HTTP_REFERER} (example.com) [NC]
RewriteRule myarticle.html http://www.cacheserver.com/myarticle.html [R,L,NC]
</IfModule>

Link.

 

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: