mod_rewrite: Displaying original URL request

There are many comprehensive examples for mod_rewrite usage – you’ll google virtually any topic.

Here’s one that I couldn’t find easily: answer to the query “how to display original url mod_rewrite”. I wanted to have client browser display original address string, not the one of a redirected page.

The answer is rather simple: don’t use [R] flag in your RewriteRule. In other words, instead of

RewriteRule ^hacking/$ wordpress/category/hacking/ [R,L]

use

RewriteRule ^hacking/$ wordpress/category/hacking/ [L]

in your .htaccess.

 


 

You can leave a response, or trackback from your own site.

Leave a Reply

You must be logged in to post a comment.