我想在我的網站上隱藏文件擴展名。
這是我.htaccess
內容:如何在網站中隱藏文件擴展名?
# Do not remove this line, otherwise mod_rewrite rules will stop working
RewriteBase/
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.html -f
RewriteRule ^([^/]+)/$ $1.html
例如:
http://example.com/website2
將映射到http://example.com/website2.html
這種方法將工作,但絕對不是接近這一目標的最佳途徑。 – Timothy