【问题标题】:on localhost Only home page is working on wordpress site在 localhost 只有主页在 wordpress 网站上工作
【发布时间】:2016-12-03 18:45:35
【问题描述】:

我有一个 WordPress 网站。这在 xampp 上运行良好,但现在我已经迁移到 lampp (Apache)。现在只有主页在工作。没有找到其他页面。这是我的 htacces 文件代码。

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /website/
RewriteRule ^index\.php$ - [L]
RewriteRule ^unsubscribe/$ /website/wp-content/plugins/email-    newsletter/unsubscribe/unsubscribe.php [QSA,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /website/index.php [L]
</IfModule>

# END WordPress

【问题讨论】:

  • 你可以使用管理区吗?
  • 是的,管理员可以访问。
  • 请检查wordpress是否有写入.htaccess的权限

标签: php wordpress .htaccess apache2


【解决方案1】:

能否请您再次保存固定链接?

第 1 步:转到wp-admin-&gt;setting-&gt;permalinks

第 2 步:保存更改后

【讨论】:

  • 能否请您备份您的.htaccess 文件,然后在保存永久链接后删除其中的所有代码?
  • 也试过了,保存了所有的htacees代码,但是还是找不到页面。如果我将永久链接更改为普通链接,页面就可以工作。
  • 请尝试使用永久链接Post name
【解决方案2】:

如果您可以使用管理区域,请转到永久链接并更新它。它会自动修复 .htacces 文件。

还要确保在您的本地堆栈上启用了 Apache 模块 mod_rewrite。

您还应该在 wp_config 中更新您的网站网址

阅读这些文章也会有所帮助:

https://codex.wordpress.org/Moving_WordPress

https://wordpress.org/support/topic/only-my-front-page-works-all-my-permalinks-are-404

【讨论】:

    【解决方案3】:

    再次更新您的固定链接 转到 wp-admin-> 设置-> 永久链接 或者你可以尝试使用波纹管功能

    函数 change_permalinks() { 全局$wp_rewrite; $wp_rewrite->set_permalink_structure('/%postname%/'); $wp_rewrite->flush_rules(); } add_action('init', 'change_permalinks');

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-02-20
      • 1970-01-01
      • 2017-12-18
      • 2017-01-28
      • 2019-12-25
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多