-1

我的服务器上运行了一个站点,这是 .htaccees 文件的内容

RewriteEngine on
RewriteCond $1 !^(index\.php|img|public|robots\.txt) [NC]
RewriteRule ^(.*)$ /index.php?/$1 [L]

几天前,我将 Wordpress 安装在一个文件夹中:example.com/my-blog/ 作为独立应用程序,但我无法访问它。如果我删除 .htaccess 文件,它确实可以正常工作,但这会使网站崩溃,无论如何我都买不起。请帮忙。

请帮忙,我是这方面的新手。

4

1 回答 1

0

您可以通过将这两行添加到您的 htaccesfile 中,在您的重写之前排除您的子文件夹:

RewriteCond %{REQUEST_URI} !^/my-blog/ [NC]
RewriteCond %{REQUEST_URI}!=/my-blog [NC]

顺便说一句,Ansari 没有设置 $1 是正确的,因此从不重写任何东西。

于 2012-05-13T22:21:32.797 回答