【问题标题】:/wp-admin/ working but no other permalinks are working due to .htaccess setup confusion/wp-admin/ 工作,但由于 .htaccess 设置混乱,没有其他永久链接工作
【发布时间】:2012-10-05 03:19:10
【问题描述】:

我需要将主页重定向到index.html和/business到/business/index.html,所以我修改了WordPress默认写的重写规则:

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

如果我删除我的规则,永久链接再次起作用,但我确实需要这些规则... /wp-admin 仍然可以正常工作。

有人有什么想法吗?

【问题讨论】:

    标签: wordpress apache .htaccess permalinks


    【解决方案1】:

    为什么要搞乱.htaccess重写规则?

    您可以在默认的 wordpress php 页面上简单地使用它:

    Header('Location: index.html');
    

    【讨论】:

    • 不知道哈哈。我只是认为这是最好的方法。谢谢。
    猜你喜欢
    • 2012-12-21
    • 2017-03-21
    • 1970-01-01
    • 2014-07-21
    • 1970-01-01
    • 2015-06-12
    • 1970-01-01
    • 2014-04-25
    • 1970-01-01
    相关资源
    最近更新 更多