Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/.htaccess/5.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文件中的限制重写规则_.htaccess_Url Rewriting_Rewrite - Fatal编程技术网

.htaccess htaccess文件中的限制重写规则

.htaccess htaccess文件中的限制重写规则,.htaccess,url-rewriting,rewrite,.htaccess,Url Rewriting,Rewrite,我在.htaccess文件中获得了一个基于php的文件,其中包含一些规则,以消除url地址栏中的文件扩展名。基本上需要http://netbureau.com.br/en/about.php/并将其转换为http://netbureau.com.br/en/about 以下是htaccess文件中的行: RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME}\.php -f Rewr

我在.htaccess文件中获得了一个基于php的文件,其中包含一些规则,以消除url地址栏中的文件扩展名。基本上需要
http://netbureau.com.br/en/about.php/
并将其转换为
http://netbureau.com.br/en/about

以下是htaccess文件中的行:

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^(.*)$ $1.php
当我试图在
http://netbureau.com.br/blog/?feed=rss2
当我试图在
http://netbureau.com.br/blog
。它被htaccess文件搞得一团糟

那么,有没有办法禁止对
/blog
文件夹执行重写规则,以便我可以恢复rss链接并在blog中设置自定义永久链接

我知道它与Wordpress同时相关,但感觉它与htaccess文件的连接比Wp更紧密

提前谢谢

编辑#1: 我已将wordpress永久链接设置为默认结构,如下所示:
http://netbureau.com.br/blog/?p=123
这使我的rss链接永久性地恢复了。 剩下的问题是Wordpress给了我自己的重写规则:

RewriteEngine On
RewriteBase /blog/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /blog/index.php [L] 
是否有办法仍然使用第一条规则应用于除/blo/文件夹之外的整个站点,并仅将WP规则应用于/blog/文件夹? 我尝试过不同的组合,但迄今为止运气不佳。我只能在没有自定义博客链接或自定义博客链接的情况下使用该网站,并且在该网站的页面上使用404。

尝试:

RewriteEngine on
RewriteCond %{REQUEST_URI} !^/blog/?
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^(.*)$ $1.php

^/blog/?
表达式排除任何以
/blog

开头的URI。感谢Jon的帮助。在进行了一些测试之后,我更新了我的问题。有没有一种方法可以应用不同的规则,例如更新的整个块,以及在使用特定文件夹的条件重新编写新规则之后?