0

我有一个在 Apache 中运行的静态站点,我希望服务器将每个文件视为一个目录。我在 .htaccess 中设置了这个东西,它将摆脱所有 .html 扩展名。所以这就是我想要的:

前任。

http://example.com/about(目前)

http://example.com/about/

无需将其更改为目录或使其动态化。有 .htaccess黑客吗?可能吗?

4

1 回答 1

1

您应该查看 mod_rewrite ,它可以让您使用正则表达式重写任何 url。

于 2012-05-20T22:51:58.167 回答