我在運行XAMPP堆棧的我的localhost
上有PHP項目。.htaccess在xamp中不工作
我想從所有面向用戶的URL中刪除.php
擴展名。
我嘗試使用Apache的mod_rewrite
在.htaccess
文件:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase/
RewriteRule ^locations(/.*)?$ poet.php [L,NC]
</IfModule>
但它是 「不工作」。
[Remove .php extension with .htaccess]可能的重複(http://stackoverflow.com/questions/4026021/remove-php-extension-with-htaccess) –
@Abhishek我看到這篇文章時,我谷歌但這個步驟沒有工作,所以最後我決定問問題 –
RewriteEngine敘述上 重寫規則^(+)\。PHP $/$ 1 [R,L] 的RewriteCond%{REQUEST_FILENAME} .PHP -f 重寫規則^(。* ?)/?$ /$1.php [NC,END] –