【发布时间】:2014-09-11 10:23:56
【问题描述】:
有以下网址,但只有第一个适用于我的 htaccess 代码。请帮助解决这两个网址的时间。谢谢。
网址 1:http://domain.com/index.php?id=Apple
输出:http://domain.com/Apple(没关系)
网址 2:http://domain.com/index.php?id=Apple-Board&jid=Chief-Accountant
输出:http://domain.com/Apple-Board(这不行)
预期输出:http://domain.com/Apple-Board/Chief-Accountant
Options -Multiviews
RewriteEngine on
RewriteCond %{THE_REQUEST} ^[A-Z]{3,}\s/+index\.php\?id=([^\s&]+) [NC]
RewriteRule ^ /%1? [R=302,L]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule ^([^/]+)/?$ index.php?id=$1 [B,L]
RewriteRule /id/(.*)/jobid/(.*)/ index.php?id=$1&jid=$2
【问题讨论】:
标签: apache .htaccess url mod-rewrite