問題描述
我一直在試圖找到一個解決方案。但我不能..
我的鏈接都是 domain.com/index.php/post_name/
我真的要刪除/index.php
我搜索並發現一些… 説我需要添加這些.. 但它不工作..
# 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
我使用 3.5.2 wp 。
如果你知道任何事情,請讓我知道。
最佳解決方案
轉到您的 WP-ADMIN – > 設置 – > 永久鏈接,並使用永久鏈接結構更改,如果生成任何.htaccess 文件複製內容並更新您的.htaccess 文件。
或者檢查您的主機 mod_rewrite 是否通過創建一個文件 phpinfo.php 與內容啓用,
<?php phpinfo();?>
上傳此文件並通過瀏覽器瀏覽。所以你知道哪些模塊被啓用。您需要使用 mod_rewrite 從 URL 中刪除 index.php 。
更多細節檢查 this link
參考文獻
注:本文內容整合自 Google/Baidu/Bing 輔助翻譯的英文資料結果。如果您對結果不滿意,可以加入我們改善翻譯效果:薇曉朵技術論壇。