这是我的.htaccess
RewriteEngine On
RewriteRule ^article/(.*)/(.*)$ article.php?one=$1&two=$2 [L]
当我去article/first/second
时这很好用
与article.php?one=fisrt&two=second
但有时只会发送一个参数:article/first
在这种情况下如何制作不同的RewriteRule或RewriteCond
管理这个链接
像article.php?one=fisrt
这是可能的吗?
答案 0 :(得分:0)
使用此规则
## not index.php
RewriteCond %{REQUEST_FILENAME} !^index.php [NC]
## if file does not exist then ignore
RewriteRule ^([\s\S]*)$ index.php?param=$1 [L,NC,QSA]