Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/wordpress/13.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
WordPress permalinks和.htaccess文件问题_Wordpress_.htaccess - Fatal编程技术网

WordPress permalinks和.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

我正在使用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]
</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();
?>