我想要的东西,把我的.htaccess
文件,将隐藏我的PHP文件.php
文件扩展名,所以要www.example.com/dir/somepage会告诉他们www.example.com/dir/somepage.php。如何使用.htaccess隐藏.php网址的扩展名?
对此有任何可行的解决方案?我的网站使用HTTPS,如果这很重要的话。
这是我此刻的.htaccess:
RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://www.example.com/$1 [R,L]
ErrorDocument 404 /error/404.php
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteCond %{REQUEST_URI} !/$
RewriteRule (.*) $1\.php [L]
重复:http://stackoverflow.com/a/1760412/209139 – TRiG 2012-04-05 12:01:29