I am using mod-rewrite to redirect friendly URLs to a php script that looks up the actual URL in an associative array and then redirects with header("location: $url");
My rewrite rule is
RewriteEngine On
RewriteCond %{REQUEST_URI} "^/$"
RewriteRule ^(.*) http://%{HTTP_HOST}/index.php [L,R=301]
RewriteCond %{REQUEST_URI} !=/home.php
RewriteCond %{REQUEST_URI} !(\.php|\.html|\.htm|\.png|\.gif|\.css|\.htm|\.js|\.txt|\.xml)$ [NC]
RewriteRule ^([^/]*)$ /home.php?page=$1 [L]
This results in the $url appearing in the browser's location bar whereas I want the friendly url to appear.
I understand from this post Rewriting URL and making new URL show in location bar why this occurs (because of the php location header) but I don't know how to achieve what I want.
There are a large number of dynamic pages that are built by several internal php scripts and writing mod-rewrite rules for all combinations of script and request parameters would be difficult.
So my questions is, how can I make the friendly url appear in the location bar.