mod_rewrite:不同域的不同规则,相同的 www-root
我有 8 个域名指向同一个 www-root。如果访问主域,您将指向index.php,从那里开始,URL 类似于:index.php?p=contact 等。但是,如果您访问其他 7 个域之一,则指向不同的单位,您最初指向:index_local.php,从那里开始它像:index_local.php?p=contact 等。
正如您可能会看到这些 URL 非常丑陋,我可以在这种情况下使用 mod_rewrite 来实现它这样index.php 和index_local.php 永远不会出现在URL 中?有没有比我现在在同一个 www 根目录中使用多个域指向用户的方式更好的方法?
I have 8 domainnames that point to the same www-root. If the main domain is accessed, you are pointed to index.php, and from there on, the URL's are like: index.php?p=contact etc. If, however, you access one of the other 7 domains, that point to different units, you are initially pointed to: index_local.php, and from there on it goes like: index_local.php?p=contact etc.
As you may see these URL's are very ugly, can I use mod_rewrite in this scenario to make it so that index.php AND index_local.php never show up in URL? Is there any better way to do this than the way I'm pointing the user now with multiple domains in the same www-root?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
像这样的东西应该有助于隐藏索引* URL:
如果您愿意更改一些代码,还有其他方法可以干净地做到这一点,但这应该适用于您拥有的代码。
Something like this should help hide the index* URLs:
There are other ways to do this cleanly, if your willing to change some code, but this should work with the code you have.