1
所有人都會問「如何刪除php擴展名」,但我想做出相反的處理。默認情況下,我的Apache配置從url中「隱藏」PHP擴展。也就是說,這兩個網址訪問相同的腳本:Apache2:如何不刪除PHP擴展?
my/path/myscript
my/path/myscript.php
是否有可能「不」刪除php擴展名? 我使用Ubuntu 16.04和Apache2。
這是我的.htaccess文件:
Options +FollowSymlinks
RewriteEngine on
# Woff type
AddType application/x-font-woff .woff
# Display PHP errors on development stage
# This line should be removed on production stage
php_flag display_errors On
# redirects all requests to index.php
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule . index.php [L]
告訴你的.htaccess如果你使用它 –