1
我有一个住在以下领域的一个项目:的.htaccess重写多个域
http://www.example.com/PROJECT/
项目中,有三个子页面,其中有网页的结构是这样的:
http://www.example.com/PROJECT/first-subpage.php?Page_ID=12345
http://www.example.com/PROJECT/second-subpage.php?Page_ID=12345
http://www.example.com/PROJECT/third-subpage.php?Page_ID=12345
我试图为其中的每一个写多个Mod重写规则,以便我可以拥有以下样式重定向的url,例如:
http://www.example.com/PROJECT/first-section/12345/some-other-text-here
>>
http://www.example.com/PROJECT/first-subpage.php?Page_ID=12345
这里是我的,但我一直没能获得比赛得到回升,根据本.htaccess tester
这里是我目前的.htaccess
文件:
RewriteEngine On
RewriteBase /PROJECT/
<filesMatch "^(/first-section/.*)">
Options +FollowSymlinks
RewriteRule ^/(.*)$/(.*)$/(.*)$ /first-subpage.php?page_ID=$2
</filesMatch>
<filesMatch "^(/second-section/.*)">
Options +FollowSymlinks
RewriteRule ^/(.*)$/(.*)$/(.*)$ /second-subpage.php?page_ID=$2
</filesMatch>
<filesMatch "^(/third-section/.*)">
Options +FollowSymlinks
RewriteRule ^/(.*)$/(.*)$/(.*)$ /third-subpage.php?page_ID=$2
</filesMatch>
我怎样才能得到这些规则来正确匹配url?
如果你的htaccess位于/ PROJECT /文件夹中,然后删除'PROJECT /'(只有'^'后面的那个) – Gerben 2012-02-21 17:21:31
@Gerben正确! – Ashraf 2012-02-21 17:53:14