的.htaccess重定向的所有文件在一个文件夹苛求在另一个文件夹相同文件夹、重定向、文件、htaccess

2023-09-02 00:46:37 作者:流云殇

我们只需要每一页动一个名为音乐,以所谓的信息......这是唯一的变化目录目录内。有很多链接到网页的音乐,我们并不想打破他们。我不是很擅长改写条件......

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 conditions....

基本上,所有我想要做的就是当音乐/ index.php的用户类型,例如,或音乐/生活/ mypage.php,简单地重定向到资料/ index.php文件或信息/生活/我的空间.PHP ...只是改变从音乐到信息。我希望做正确的网址(信息)在URL框中显示。

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.

...我是pretty的激怒。我一直试图让这件事的所有该死的下午!

...I'm pretty exasperated. I've been trying to get this thing all darn afternoon!

推荐答案

使用反向引用了这样一句:

Use backreferences for this one:

RewriteRule ^foo/(.*)$ bar/$1