在文件 .htaccess 中,我使用以下规则:
# enable URI rewrite
RewriteEngine On
# if request is for an actual file or directory on disk,
# then do not continue with rewrite engine
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^category/([^/]+)/([^/]+)/([^/]+)(?:/([^/]+))?/? index.php?to=prepared§ion=$1&category=$2&orderby=$3&filter=$4 [L,QSA]
当POST查询“orderby”为空并且我希望默认为其分配一些值(例如“rating”)时,如何为案例制定规则?
如果根本没有“orderby”,我想添加一个默认的“orderby”参数!
非常感谢!