【问题标题】:Redirect https://<rootsite>/store to https://store.<rootsite>/将 https://<rootsite>/store 重定向到 https://store.<rootsite>/
【发布时间】:2020-04-16 06:35:46
【问题描述】:

所以我的网络服务器的结构位于/var/www/html,我的存储目录位于/var/www/html/store,这样我就可以在不使用链接的情况下共享资源,因为它会混淆 PhPStorm。

我想强制将任何试图访问 https://&lt;rootsite&gt;/store 的人重定向到 https://store.&lt;rootsite&gt;/。如果有帮助,我启用了.htaccess,PHP 和 js。

【问题讨论】:

  • 你尝试了什么?
  • 我尝试了重定向,但最终导致浏览器崩溃。 store.<rootsite> 映射到 FS 中的 https:///store

标签: php html .htaccess apache2


【解决方案1】:

使用 PHP 的重定向功能完成工作。

header('Location: https://store.<rootsite>/');

【讨论】:

  • 如果我把它放在PHP文件中,它不会一遍又一遍地重定向到同一个文件吗?
猜你喜欢
  • 2020-09-11
  • 2017-04-02
  • 2016-09-24
  • 1970-01-01
  • 2016-03-10
  • 2015-09-25
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多