开发者

mod_rewrite later rule overide general rule

I have an htaccess file that contains the following line:

RewriteRule ^department/([a-z]+)/([a-z0-9_-]+)$ departmentpage.php?dep=$1&pagename=$2

I want to create a contact page and want the later specific rule override the previous, like cascading stylesheets.

The following rule looks like its getting ignored:

RewriteRule ^department/([a-z]+)/contact$ departmentpage.php?dep=$1&

Is there anyway for the 2nd more specific 开发者_StackOverflow社区rewrite to override the general rewrite?

RewriteRule ^department/([a-z]+)/([a-z0-9_-]+)$ departmentpage.php?dep=$1&pagename=$2
RewriteRule ^department/([a-z]+)/contact$ departmentpage.php?dep=$1


Switch the order of the rules (and use [L] if necessary).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜