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
如何允许使用.htaccess访问1个特定url?_.htaccess_Redirect - Fatal编程技术网

如何允许使用.htaccess访问1个特定url?

如何允许使用.htaccess访问1个特定url?,.htaccess,redirect,.htaccess,Redirect,我有一个工作完美的htaccess: rewriteengine on rewritecond %{HTTP_HOST} ^www.somedomain.com$ [OR] rewritecond %{HTTP_HOST} ^somedomain.com$ rewriterule ^$ "http\:\/\/somedomain\.com\/n" [R=301,L] #4ecde5cb862ff addhandler x-httpd-php5-cgi .php5 addhandler x-h

我有一个工作完美的htaccess:

rewriteengine on
rewritecond %{HTTP_HOST} ^www.somedomain.com$ [OR]
rewritecond %{HTTP_HOST} ^somedomain.com$
rewriterule ^$ "http\:\/\/somedomain\.com\/n" [R=301,L] #4ecde5cb862ff


addhandler x-httpd-php5-cgi .php5
addhandler x-httpd-php5-cgi .php
我想要的是允许访问仍然在服务器上的旧urlhttp://somedomain.com/footer/ingredients/index.htm

我该怎么做?我几乎不知道如何处理特定情况下的htaccess,比如这个=/而且url的最后部分可能会更改为page2.htm,直到page6.htm

编辑

我已经尝试添加

RewriteCond %{REQUEST_URI} !^/footer
重新启动发动机后,以及

RewriteCond %{REQUEST_URI} !^/footer/?$

然而,这些作品都不应该影响你的重写规则,我知道它不应该影响,但它确实影响了。如果我尝试进入该url,我会被重定向到somedomain.com/n/=/我同意,该规则不应影响index.html。可能是因为有不同的规则,301被缓存在浏览器中。从不同的浏览器尝试,或者在私人浏览模式下验证我已经在不同的浏览器和Chrome的匿名模式下尝试过了,还有什么我可以检查的吗?根文件夹上还有其他.htaccess,但它们的名称已更改。htaccess.old或.htaccess\u copy,因此不能是它=/