【发布时间】:2019-04-25 06:09:40
【问题描述】:
如何在 .htaccess 中创建子域
example.domain.com/gallery/index.html
进入example.domain.com/gallery/
【问题讨论】:
-
通过为该请求 URL 实施重写规则。你会在网上找到无数的例子。
-
做了很多例子,我得到了 500 错误
-
好的,那么请展示其中的一两个示例,并将您收到的条目添加到您的 http 服务器错误日志文件中。
-
RewriteRule ^gallery/([A-Za-z]+)/$ /gallery/index/$1.html [L] -
嗯,直接的方法类似于
RewriteRule ^/?gallery/index\.html$ /gallery/ [END]。但这可能会导致无休止的重写循环,具体取决于我们不知道的设置。
标签: .htaccess url mod-rewrite path