Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/.htaccess/6.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
Php url重写-任何为我的所有网页编写通用规则的方法_Php_.htaccess_Mod Rewrite_Url Rewriting - Fatal编程技术网

Php url重写-任何为我的所有网页编写通用规则的方法

Php url重写-任何为我的所有网页编写通用规则的方法,php,.htaccess,mod-rewrite,url-rewriting,Php,.htaccess,Mod Rewrite,Url Rewriting,我正在开发一个网站。在这里,我在.htaccess中实现了URL重写。 我有一个用于所有页面的公共动态变量(?offset=1) e、 g 我已经成功地为区域页面实现了干净的URL。看到我的代码了吗 RewriteRule manageZone-offset-(.*)\.html$ manageZone.html?offset=$1 RewriteRule manageZone-offset-(.*)\.htm$ manageZone.php?offset=$1 我知道在每一页上都可以添加这

我正在开发一个网站。在这里,我在.htaccess中实现了URL重写。 我有一个用于所有页面的公共动态变量(?offset=1) e、 g

我已经成功地为区域页面实现了干净的URL。看到我的代码了吗

RewriteRule manageZone-offset-(.*)\.html$ manageZone.html?offset=$1 
RewriteRule manageZone-offset-(.*)\.htm$ manageZone.php?offset=$1
我知道在每一页上都可以添加这个

RewriteRule manageState-offset-(.*)\.html$ manageState.html?offset=$1   
RewriteRule manageState-offset-(.*)\.htm$ manageState.php?offset=$1
但有没有办法为所有这些页面编写通用规则


谢谢

为什么要将.html页面重写为
.html?偏移量=…
RewriteRule manage([a-z]+)-offset-(\d+)\.html?$ manage$1.php?offset=$2 [NC]
RewriteRule manage([a-z]+)-offset-(\d+)\.html?$ manage$1.php?offset=$2 [NC]