简体   繁体   English

在Wordpress之外使用子文件夹会出现404错误

[英]Using a subfolder outside of Wordpress is giving 404 errors

I have Wordpress installed on root and I'm using a subfolder called "uploads" for a file uploading script I'm using. 我在根目录上安装了Wordpress,并且正在使用一个名为“ uploads”的子文件夹来存储我正在使用的文件上传脚本。 The problem is I get 404 errors when navigating to a subpage within Wordpress (site.com/subpage). 问题是导航到Wordpress中的子页面(site.com/subpage)时出现404错误。 I believe it's a problem with my htaccess file. 我相信我的htaccess文件有问题。 I've tried several variations, but this is what I'm currently using: 我已经尝试了几种变体,但这是我目前正在使用的:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI} ^/uploads/(.*)$ [OR]
RewriteRule ^.*$ - [L]
</IfModule>


# 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

Any clues on what is producing the 404 error would be much appreciated! 任何产生404错误的线索将不胜感激!

Could you please try replacing your rewrite base with the path to your subfolder? 您能否尝试用子文件夹的路径替换您的重写库?

ie from 即从

RewriteBase /

to

RewriteBase /subpage/

Do this in all the rewrite base statements in your htaccess 在htaccess中的所有重写基本语句中执行此操作

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM