
是否可以直接在 Apache httpd.conf 中設定 WordPress 永久連結?
我有一個伺服器情況(Apache 2.2.3 CentOS PHP5.1.6),我因為效能原因無法使用.htaccess,但可以使用httpd.conf。
管理員說 mod_rewrite 已啟用,但 AllowOverride 未啟用,我無法更改這些設定。
我需要將永久連結限制為僅“部落格”目錄。
這是 .htaccess 中的內容,但需要進入 httpd.conf:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /blog/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /blog/index.php [L]
</IfModule>
謝謝...
答案1
將其放入您網站的容器中。
<Directory /path/to/blog/>
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /blog/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /blog/index.php [L]
</IfModule>
</Directory>