首页 文章

404错误:在Wordpress的子文件夹中访问PHP应用程序

提问于
浏览
2

我在我的域的根文件夹中安装了wordpress . 这是我的主要网站 . 现在我想在子文件夹中安装CodeIgnitor PHP应用程序(它与wordpress无关,它只需要在同一个域中)所以domain.com/folder/

但是我在wordpress中遇到404错误 .

如果我输入domain / folder / index.php / login - >它会将我带到登录页面 - 但我仍然无法超越 .

请帮忙 .

这是我目前的.htaccess

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress

2 回答

  • 0

    _2424255_的WordPress部分中的 rewritecond 将确保任何不是't an actual file or directory will be handled by WP, so your CI never gets a chance to see it. Changing the rewrite rule as follows will exclude your subdir from WP'的URL .

    RewriteRule ^(?!folder(?:$|/)). /index.php [L]
    

    这是一个负面的前瞻断言,可以确保如果路径只是 /folder ,则CI将获取URL,或者以 /folder/ 开头 . 您需要这两种情况,以便Apache可以正常处理目录URL .

  • -1

    试试这个

    • 登录wp-admin

    • 转到设置→永久链接

    • 更新至 post name

相关问题