【发布时间】:2018-07-08 01:53:01
【问题描述】:
我目前有以下位置:localhost/dir1/ex.html
我正在尝试实现dir1.localhost/ex.html 映射到第一个网址的情况。以下 .htaccess 规则有效:
RewriteCond %{HTTP_HOST} =dir1.localhost
RewriteRule ^(.*)$ http://localhost/dir1/$1 [L]
但是,这不是我想要的,因为它很明显会重定向。我想保持网址不变(dir1.localhost)。
如何去做这件事?非常感谢。
【问题讨论】:
标签: regex apache .htaccess url-rewriting