我有一个在Apache中运行的静态站点,我希望服务器将每个文件视为一个目录。我在.htaccess中设置了这个东西,它将摆脱所有.html扩展名。所以这就是我想要的:
前任。
http://example.com/about (目前(
自
http://example.com/about/
无需将其更改为目录或使其动态化。有.htaccess黑客吗?可能吗?
您应该查看mod_rewrite它允许您使用正则表达式重写任何URL。