开发者

mod_rewrite later rule overide general rule

开发者 https://www.devze.com 2023-02-04 08:31 出处:网络
I have an htaccess file that contains the following line: RewriteRule ^department/([a-z]+)/([a-z0-9_-]+)$ departmentpage.php?dep=$1&pagename=$2

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

精彩评论

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