We simply have to move every page inside of a directory called "Music" to a directory called "Information"... That's the only change. There's lots of links to pages music and we don't want to break them all. I'm not great at rewrite condi开发者_Python百科tions....
Basically, all I want to do is when a user types in music/index.php, for example, or music/life/mypage.php, to simply redirect it to information/index.php or information/life/mypage.php... just change from music to information. And I do want the correct URL (information) to show in the URL box.
...I'm pretty exasperated. I've been trying to get this thing all darn afternoon!
Use backreferences for this one:
RewriteRule ^foo/(.*)$ bar/$1
RedirectMatch ^/foo/bar/(.*) http://www.wherever.org/a/foo/bar/$1
精彩评论