【问题标题】:Wordpress 3.8.1 Multisite Subdirectory WP-Admin 404 Error - Tried EverythingWordpress 3.8.1 多站点子目录 WP-Admin 404 错误 - 尝试了一切
【发布时间】:2014-04-28 16:20:48
【问题描述】:

域名是 www.sandersonathletics.org

Wordpress 3.8.1,带有子目录的多站点。

在新的子目录站点上发现了出现的错误; www.sandersonathletics.org/football - 未格式化 AND www.sandersonathletics.org/football/wp-admin 404 错误

  1. 我已验证 .htaccess 文件与 Wordpress 中的内容匹配。
  2. 我已验证 .htaccess(public_html 根目录)的适当位置
  3. 我已经验证了 wp-config 文件并且多站点数据的位置在正确的位置,并且我已经检查了那里的内容。
  4. 我查看了 mysql 数据库中的条目以及 www. wp-config、数据库等中的匹配项(主持人建议这样做)
  5. 我已将插件目录重命名为 plugin-bak 以调试插件问题。那没有效果。
  6. 我目前托管在 Dreamhost 共享服务器上。

.htaccess

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]

# add a trailing slash to /wp-admin
RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]

RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
RewriteRule . index.php [L]
</IfModule>

【问题讨论】:

  • 更新了我为尝试使其正常工作而采取的措施。第 3 天,仍然无法正常工作; 7. 我尝试根据过去的建议将 mod_rewrite.c 更改为 .so。那没有用,所以我把它改回来了。 8. 我已经将contents、includes和admin的所有权限递归设置为755权限。

标签: wordpress .htaccess http-status-code-404


【解决方案1】:

在 Ubuntu 16.04 WP 4.9.7 和 PHP7 上测试的工作解决方案:

来源: https://wordpress.stackexchange.com/questions/167294/multisite-404-error-for-subdirectory

编辑此文件 /etc/apache2/sites-enabled/.conf

让它看起来像这样:

<VirtualHost *:80>

        ServerAdmin webmaster@localhost
        DocumentRoot /var/www/html

        <Directory />
                Options FollowSymLinks
                AllowOverride all
        </Directory>
        <Directory /var/www/>
                Options FollowSymLinks
                AllowOverride all
                Order allow,deny
                allow from all
        </Directory>

        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined

</VirtualHost>

使它起作用的部分是:

<Directory />
                Options FollowSymLinks
                AllowOverride all
        </Directory>

        <Directory /var/www/>
                Options FollowSymLinks
                AllowOverride all
                Order allow,deny
                allow from all
        </Directory>

重启apache:

sudo service apache2 重启

你有它!测试您的网站。

【讨论】:

    猜你喜欢
    • 2016-07-27
    • 2015-04-15
    • 1970-01-01
    • 1970-01-01
    • 2015-07-14
    • 2014-12-08
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多