WordPress 3.0 及更高版本后 404 一直杀了我

发布于 2024-11-03 21:32:31 字数 330 浏览 0 评论 0原文

自 Wordpress v3.0 以来,您做了什么,所有直接 PHP 文件都无法在 WP 中工作,所有都返回 404 page not found,我创建了一个插件,它正在加载 /wp-content /plugins/myplugin/direct.php 文件,我现在看到了什么,它向我显示了我的 WP 网站,标题为 PAGE NOT FOUND 404,请帮助我,我无法使用 WP任何此外,所有直接 PHP 文件都无法访问并被跟踪为 404。 我应该怎么做才能关闭那个可怕的 404 或加载我的 php 文件。

what have you done since Wordpress v3.0, all direct PHP files are not working in WP, all are returning 404 page not found, I have created one plugin, it's loading /wp-content/plugins/myplugin/direct.php file and what am I seeing now, it shows me my WP site with title PAGE NOT FOUND 404, help me please I can't work with WP any more, all direct PHP files are not accessible and tracked as 404.
What should I do to turn off that terrible 404 or get my php files loaded.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

乖乖兔^ω^ 2024-11-10 21:32:32

根据提供的重写规则,我建议改用它:

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^.*shop/images/(\d+)/?\??(.*)$ /wp-content/plugins/shopp/core/image.php?siid=$1&$2 [QSA,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress

Based on the provided rewrite rules, I would suggest to use this instead:

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^.*shop/images/(\d+)/?\??(.*)$ /wp-content/plugins/shopp/core/image.php?siid=$1&$2 [QSA,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
み零 2024-11-10 21:32:32

我不明白这个问题。您是说您已经创建了一个插件,但它没有正确调用文件? (我假设“直接 PHP 文件访问”意味着您无法加载插件目录中的特定文件?)

听起来您没有使用正确的路径。您应该使用通过 WordPress (http://codex.wordpress.org/Determining_Plugin_and_Content_Directories) 设置的 WP_PLUGIN_URL 常量之类的东西 - 即这听起来不像 .htaccess 问题,听起来像是插件中的编码不正确。

当然,如果不知道您正在使用什么代码,就很难说出问题所在。

I'm not understanding the question. You're saying that you've created a plugin, and it's not calling in the files properly? (I'm assuming by "direct PHP file access" you mean you can't load a particular file that's within your plugin directory?)

Sounds like you're not using the correct paths. You should be using things like WP_PLUGIN_URL constants that are set up for you via WordPress (http://codex.wordpress.org/Determining_Plugin_and_Content_Directories) - i.e it doesn't sound like an .htaccess issue, it sounds like improper coding in the plugin.

Of course, without knowing what code you are using, it's difficult to say what the issue could be.

太傻旳人生 2024-11-10 21:32:31

检查你的.htaccess文件,也许所有URL现在都映射到Wordpress的index.php文件了。

Check your .htaccess file, maybe all URLs now are mapped to the index.php file of Wordpress.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文