变化的RewriteBase视域 [英] change RewriteBase depending on domain

查看:143
本文介绍了变化的RewriteBase视域的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我必须设置的RewriteBase视域,现在的RewriteBase设置为〜/名为myusername /文件夹/ site.com,如果有人打开的 http://mydomain.com 重定向到(共享HTTPS)的https:/ /something.hostingproveder/~myusername/folder/site.com ,现在我想用我的真实域,而无需HTTPS,如果我使用它,我需要的RewriteBase改变/或彻底删除它...

I have to set RewriteBase depending on the domain, right now RewriteBase is set to ~/myusername/folder/site.com, if someone opens http://mydomain.com it redirects to (shared HTTPS) https://something.hostingproveder/~myusername/folder/site.com , now I want to use my real domain without https and if I'm using it I need to change RewriteBase to / or to completely delete it...

有什么在.htacces,可以检查该域名的使用和依赖于域设置的RewriteBase。

Is there something in .htacces that can check which domain is used and set RewriteBase depending on domain.

推荐答案

有没有办法在.htaccess动态设置的RewriteBase。

There is no way to dynamically set RewriteBase in .htaccess.

不过,如果你有机会到你的httpd.conf <一个href="http://stackoverflow.com/questions/2501536/kohana3-different-htaccess-rewritebase-and-kohana-base-url-for-dev-and-product">here是用来做这件事 AccessFileName

However, if you have access to your httpd.conf here is one way to do it using AccessFileName

即使你没有访问到你的httpd.conf,同一职位上面有一个聪明的方法来使用环境变量(由mozillalives回答)来实现类似的结果。

Even if you do not have access to your httpd.conf, the same post above has a clever way to use Environment variables (answer by mozillalives) to achieve a similar result.

这篇关于变化的RewriteBase视域的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆