[英]WordPress permalinks and .htaccess file issue
我正在使用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
這不適用於我的永久鏈接/%postname%
可能是什么問題?
1.-確保你的固定Permalink Settings
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>
5.-服務器配置中的任何更改重新啟動后(再次在ubuntu中):
$ sudo service apache2 restart
您使用的是哪個版本的Apache? 另外,請確保使用檢查測試頁
<?php
phpinfo();
?>
和CTRL + F表示“mod_rewrite”。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.