WordPress permalinks和.htaccess文件问题
我正在使用WordPress.htaccess文件,如下所示WordPress permalinks和.htaccess文件问题,wordpress,.htaccess,Wordpress,.htaccess,我正在使用WordPress.htaccess文件,如下所示 # BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </If
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
#开始WordPress
重新启动发动机
重写基/
重写规则^index\.php$-[L]
重写cond%{REQUEST_FILENAME}-F
重写cond%{REQUEST_FILENAME}-D
重写规则/index.php[L]
#结束WordPress
这不适用于我的permalink/%postname%
可能有什么问题?1。-请确保在
Permalink设置中设置permalinks
http://your_domain/wp admin/options-Permalink.php
2.-如果在子目录中使用WP,则必须修改htaccess:
RewriteBase /subdir/
更新:
3.-启用重写模块。在ubuntu中很容易:
sudo a2enmod rewrite
4.-在服务器配置中允许.htaccess
<Directory /your_wp_dir>
AllowOverride All
</Directory>
您使用的是什么版本的Apache?此外,请确保使用检查测试页面
<?php
phpinfo();
?>
CTRL+F表示“mod_rewrite”。可能在子目录中有WP?如果WP在子目录中,请将RewriteBase更改为/subdir/my WP在根目录中,您确定在博客设置中设置了“use permalinks”吗?好的,我在哪里可以找到此设置?我的php版本是5.2.17,我没有找到“mod_rewrite”有什么解决办法吗???@user1932682看看我的答案!我把关于启用
mod_rewrite
的信息放在这里,很抱歉日志延迟,仍然习惯于参与。无论如何,您需要mod_requite才能将PHP文件“重写”为永久链接。看看下面的答案,我认为@NomikOS把这些东西归结为一门科学。
<?php
phpinfo();
?>