.htaccess 设置默认 URL 解析的方法?
我们有两个站点,并且我们刚刚制作了一个内部开发服务器,我们希望两个站点都位于该服务器上。我想要完成的是在每个站点文件夹中都有一个 .htaccess
,该文件夹前置站点的开发 URL。例如,如果他们只有一个标头(位置:/folder/whatever.php),则文件实际上应该转到thesite/folder/whatever.php
。
目前发生的情况是(例如)他们将转到 192.168.xx/folder/whatever.php
We have two sites, and we've just now made an in-house development server that we want to have both sites on. What I want to accomplish is to have an .htaccess
in each of the site folders that prepends the development URL of the site. For example, where they simply have a header(location: /folder/whatever.php)
, the files should actually go to thesite/folder/whatever.php
.
Currently what happens is (for example) they'll go to 192.168.x.x/folder/whatever.php
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果我理解正确并且您想要的是将
192.168.xx/folder/whatever.php
重定向到thesite/folder/whatever.php
,您可以使用以下命令:If I understood correctly and what you want is to redirect
192.168.x.x/folder/whatever.php
tothesite/folder/whatever.php
, you could use this: