用 Joomla 4 建置新网站,开启 SEO 及 URL Rewrite 后,网站就出现问题,一开始 Google 到自己的文章 -「的Joomla URL重写 404 无法显示网页“,主要是因为没把 httpd.conf 的 AllowOverride 设为 All 导致。但这次设完后,卻變成 403 禁止的,且是所有页面都进不去,不管该页网址有没有用到 rewrite,研究了几个小时,总算找到原因。
要使用 URL Rewrite,有下列設定值需設定:
1. 阿帕奇 – LoadModule rewrite_module
2. 阿帕奇 – Options FollowSymLinks
3. 阿帕奇 – AllowOverride All
4. .htaccess – RewriteEngine On
而我的問題在於以上四個都已設定,卻出現 403 禁止的,其中 2. 跟 3. 我在 httpd.conf 及 httpd-ahssl.conf 皆試過。
為了簡化測試環境以釐清問題,我將 .htaccess 內容只留下 RewriteEngine On 這行字,並將檔案放在 htdocs 根目錄。另外製作一個 test.php 檔,内容如下,單純顯示 php 環境資訊,此檔同樣放在 htdocs 根目錄。
<?php phpinfo(); ?>
當瀏覽 http://abc.com/test.php 時,同樣出現 403 禁止的,而去查詢 Apache 的 error.log 時,可以看到這樣的錯誤:
Options FollowSymLinks and SymLinksIfOwnerMatch are both off, so the RewriteRule directive is also forbidden due to its similar ability to circumvent directory restrictions : Ç:/Web/Apache24/htdocs/test.php
因此可以將問題的範圍縮小到 FollowSymLinks 這個參數上。再三確認 httpd.conf 有正確設定 FollowSymLinks 後,我開始逐一檢視與比對新舊網站的 httpd.conf 差異。後來注意到新網站除了在 SSL 的部份是引用 httpd-ahssl.conf (Include conf/extra/httpd-ahssl.conf) 設定檔外,FastCGI 的部份也是引用外部 httpd-fcgid.conf (Include conf/extra/httpd-fcgid.conf) 設定檔,也就是說我舊網站的設定都在 httpd.conf,但新網站是用到三個設定檔(httpd.conf、httpd-ahssl.conf、httpd-fcgid.conf)。其中 httpd.conf 跟 httpd-ahssl.conf 我已經試過,所以問題的癥結應該就在 httpd-fcgid.conf。
打開 httpd-fcgid.conf,在

【相关连结】
- 的Joomla URL重写 404 无法显示网页 | 老森常譚
Is FortiGate 50E 6.2.10 the best?
https://it-help.tips/fortigate-firmware-download/
Help!
Is FortiGate 50E 6.2.10 the best?
是.