【问题标题】:Wordpress redirect to xampp's dashboard except homepageWordpress 重定向到 xampp 的仪表板,除了主页
【发布时间】:2018-03-19 20:54:21
【问题描述】:

我的系统是 MAC,我正在运行 Xampp for mac。

我搜索了很多解决方案,我认为这一定是因为我的 .htaccess 丢失文件,我在 wordpress 中的所有其余链接甚至我的帖子,页面 除了我的主页 重定向到 localhost/仪表板是xampp的仪表板。

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

这是我的 .htaccess 文件,我已经设置好了

<Directory />
    AllowOverride all
    Require all denied
</Directory>

在 apache httpd.conf 文件中

现在我还能做什么?我坚持这一点,即使我点击我的 wp-admin 页面上的永久链接,它也显示没有找到对象,404 错误。页面退出,帖子存在,一切都存在,但我仍然只能看到主页。

【问题讨论】:

    标签: php wordpress apache .htaccess


    【解决方案1】:

    经过几个小时的搜索,我发现我需要为我的根 wordpress 文件夹授予写权限,因此它是通过

    sudo chmod -R 777 wordpress
    

    【讨论】:

      【解决方案2】:

      应该是这样的

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

      【讨论】:

        【解决方案3】:

        由于 WordPress 似乎位于 /wordpress/,请将 RewriteRule . /index.php [L] 更改为 RewriteRule . /wordpress/index.php [L]

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 2021-01-09
          • 2023-04-06
          • 2019-02-13
          • 2017-06-28
          • 2017-09-24
          • 2020-11-09
          • 2018-05-13
          相关资源
          最近更新 更多