URL rewriting that visibly rewrites (changes the URL in the address bar) URL rewriting that visibly rewrites (changes the URL in the address bar) apache apache

URL rewriting that visibly rewrites (changes the URL in the address bar)


As I cannot leave comments now, I'll post my addition to Ignacio's comment here.

You actually should post a 301 (Moved Permanently) redirect, as you're describing there's a new site directory structure. So your RewriteRule should read

RewriteRule ^oldscheme/(.*)/?$  newscheme/$1  [R=301]


It turns out adding a "redirect" code does the trick:

RewriteRule ^oldscheme/(.*)/?$  newscheme/$1  [R]

Obvious in retrospect, but hopefully this makes the answer more searchable.I found it on this excellent "cheat sheet":

http://www.addedbytes.com/cheat-sheets/mod_rewrite-cheat-sheet/