Wordpress - 通过HTACCESS忽略目录

时间:2013-07-19 15:07:42

标签: wordpress .htaccess

我一直在尝试(不成功)忽略Wordpress站点根目录中的目录。无论我做什么,它似乎只显示这些页面的404页面。 HTACCESS规则如下,我试图忽略/ bet-reports /

BEGIN WordPress

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI} !^/(bet-reports|bet-reports/.*)$
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress

RewriteCond %{HTTP_HOST} ^doawildthing.com$ [OR]
RewriteCond %{HTTP_HOST} ^www.doawildthing.com$
RewriteRule ^/?$ "http\:\/\/wildthingfootball\.com\/" [R=302,L]

感谢任何帮助!

2 个答案:

答案 0 :(得分:0)

试试这段代码:

<Directory "/bet-reports/">
Deny from all
</Directory>

答案 1 :(得分:0)

试试这个:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI} ^/(bet-reports.*)$
RewriteRule . /someotherpage.html [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>