使用以下代碼從 URLS 中洗掉 php,適用于我的在線服務器,但不適用于 XAMPP 本地主機
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^(.*[^/])/?$ $1.php [L]
我已經嘗試在 httpd.conf 檔案中將 AllowOverride 更改為 all 并更改 conf 檔案中的其他設定,但無法弄清楚是什么阻止了它
TIA
uj5u.com熱心網友回復:
確保您已在 xampp 中打開mod_rewrite(默認情況下,它可以在您的在線服務器中打開)。
在這里您可以查看如何操作:https : //ubiq.co/tech-blog/how-to-enable-mod_rewrite-in-xampp-wamp/
轉載請註明出處,本文鏈接:https://www.uj5u.com/net/357882.html
