2 Answers
2

mod_rewrite is the wrong place to make URL's "friendly". This has to happen inside the web application, because it creates the links inside the pages in the first place.

You need rewrite rules to translate this "friendly" URLs back into something the web app can understand. What kind of rules you need depends on the app you use (which you don't name) and you should find this in the documentation.

This rewrite rule alone will enable both "friendly" urls and "ugly" urls: same content is accessible via two urls.

.htaccess rewrite rules are to route requests to the .php script responsible for the content requested.

Urls generated into html by .php script are presented to a user and it is up to you as a php-developer to generate "friendly" urls.

You may even force the usage of friendly urls by adding either adding Redirect rules to .htaccess or header("Location: ....") to your php scripts.

Note that even after you have changed your php scripts to generate only friendly urls, you may still see in web-server logs the requests of old ugly urls - this is because your site has been crawled by search engines or some links to your pages were copied to other sites (blogs, forums) - it is ok.