.htaccess htaccess参数
我有以下重写。最后一个是PAR ID,但我想它是可变的,必须是ID或数量,这是可能的吗? 现在: 必须是:.htaccess htaccess参数,.htaccess,url-parameters,.htaccess,Url Parameters,我有以下重写。最后一个是PAR ID,但我想它是可变的,必须是ID或数量,这是可能的吗? 现在: 必须是: RewriteRule ^([a-z0-9\-]+)/([a-z0-9\-]+)/([a-z0-9\-]+)/?$ index.php?action=$1&item=$2&id=$3 [NC,L] RewriteRule ^([a-z0-9\-]+)/([a-z0-9\-]+)/([a-z0-9\-]+)/?$ index.php?action=$1&item=$2
RewriteRule ^([a-z0-9\-]+)/([a-z0-9\-]+)/([a-z0-9\-]+)/?$ index.php?action=$1&item=$2&id=$3 [NC,L]
RewriteRule ^([a-z0-9\-]+)/([a-z0-9\-]+)/([a-z0-9\-]+)/?$ index.php?action=$1&item=$2&quantity=$3 [NC,L]
我认为你不能在
.htaccess
您可能正在寻找:
RewriteRule ^([a-z0-9-]+)/([a-z0-9-]+)/([a-z0-9-]+)/?$ index.php?action=$1&item=$2&id=$3&quantity=$3 [NC,L]
在index.php
中,您可以确定$3是ID还是数量
RewriteRule ^([a-z0-9-]+)/([a-z0-9-]+)/([a-z0-9-]+)/?$ index.php?action=$1&item=$2&id=$3&quantity=$3 [NC,L]