简体   繁体   中英

htaccess RewriteRule with 3 rules and 2 different PHP Files ( ERROR )

I have 3 rules, but when the variable is blank (example.com/) I need it to load the index.php, but the 2nd rule and 3rd rule never get executed

how do I solve it?

Options +FollowSymLinks
RewriteEngine on

RewriteRule ^(PanelControl|Home|Pages|Gallery|Password)?$ panel.php?module=$1 [L,NC]
RewriteRule ^([a-zA-Z0-9\-]+)/([a-zA-Z0-9\-]+)/?$ index.php?page=$1&subpage=$2 [L,NC]
RewriteRule ^([a-zA-Z0-9\-]+)/?$ index.php?page=$1 [L,NC]

Note: 1st Rule works

第一条规则的解决方案是:

RewriteRule ^PanelControl|Home|Pages|Gallery|Password/?$ panel.php?module=$1 [L,NC]

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM