WordPress

CentOS WordPress設定永久連結卻無法正常瀏覽

前言

WordPress設定永久連結卻無法正常瀏覽的解決方法
WordPress

WordPress Httpd設定

設定網頁讀取.htaccess檔案

<Directory /var/www/{wordpress_path}>
    AllowOverride All
</Directory>

設定完成後記得重啟httpd服務

sudo service httpd restart

.htaccess

至WordPress根目錄下

vi .htaccess

加入代碼

<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
</IfModule>

記得存檔喔

:wq

原本無法瀏覽的連結,即可正常瀏覽。

Leave a Reply

Your email address will not be published. Required fields are marked *