Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/pandas/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
.htaccess基于数值的重写规则_.htaccess_Url Rewriting - Fatal编程技术网

.htaccess基于数值的重写规则

.htaccess基于数值的重写规则,.htaccess,url-rewriting,.htaccess,Url Rewriting,我想在htaccess上执行重写规则。应重写以下URL: 我想制作一个重写URL,识别“-p”,然后是一个数值。我如何制定这个规则?我有以下内容,但不确定如何向其中添加数值: RewriteRule ^(.*)/(.*)/(.*)/(.*)-p(.*)/?$ /file.php?folder=$1&subfolder=$2&subsub=$3&product=$4&id=$5 但是,在以下URL的情况下,这当然是错误的: 如何添加URL应以“-p”结尾并后跟

我想在htaccess上执行重写规则。应重写以下URL:

我想制作一个重写URL,识别“-p”,然后是一个数值。我如何制定这个规则?我有以下内容,但不确定如何向其中添加数值:

RewriteRule ^(.*)/(.*)/(.*)/(.*)-p(.*)/?$ /file.php?folder=$1&subfolder=$2&subsub=$3&product=$4&id=$5
但是,在以下URL的情况下,这当然是错误的:

如何添加URL应以“-p”结尾并后跟一个数值的条件?

p([0-9]+)应起作用。p([0-9]+)应起作用。