Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/batch-file/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
apache重写规则覆盖具有相似名称的url_Apache_Mod Rewrite_Url Rewriting_Rewrite - Fatal编程技术网

apache重写规则覆盖具有相似名称的url

apache重写规则覆盖具有相似名称的url,apache,mod-rewrite,url-rewriting,rewrite,Apache,Mod Rewrite,Url Rewriting,Rewrite,下面的“morehere”规则被跳过,并重定向到“more”规则。如何将其设置为“更多”规则仅在此处指向url/more而不是/more RewriteRule ^morehere /morehere.html [NC,R,L] RewriteRule ^more /index#more [redirect=permanent,last,noescape] *编辑 我真的不需要“morehere”规则。这只是一种创建指向锚的重写的方法,如果重写词包含在其他页面名称中,则不会干扰其他页面。第一条

下面的“morehere”规则被跳过,并重定向到“more”规则。如何将其设置为“更多”规则仅在此处指向url/more而不是/more

RewriteRule ^morehere /morehere.html [NC,R,L]
RewriteRule ^more /index#more [redirect=permanent,last,noescape]
*编辑


我真的不需要“morehere”规则。这只是一种创建指向锚的重写的方法,如果重写词包含在其他页面名称中,则不会干扰其他页面。

第一条规则是一条终端规则,将以与第二条规则匹配的新请求结束。在第二条规则前面加上一个条件:

RewriteCond %{REQUEST_URI} !^morehere\.html

这会在url上强制使用.html,但真正的问题是,任何包含更多内容的url都会将流量定向到“更多”重写。有没有办法限制“more”规则,使其只重写与/more而不是/moretuff直接匹配的URL?