我有一个WordPress博客,我想在其中添加一些自定义页面,并从urls中删除.php扩展和查询字符串。
所有WordPress页面urls都类似于index.php?pagename=,因此如果我尝试在.htaccess文件中添加RewriteRule ^(.*)$ $1.php,其他页面将返回500 internal server error。如何从除index.php和login.php之外的所有文件中删除php扩展
下面是我现有的.htaccess文件:
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
因此,我已经寻找了一段时间,似乎找不到一个特定的解决方案,我正在寻找。我看过很多文章,展示了如何修复wordpress重写中的问题,但没有一篇能解决我的问题。
我现在在我的/根目录中安装了Wordpress。.htaccess看起来是这样的。
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^manager - [L,NC] <-- I added this from other examples.
RewriteRule ^index\.php$ -