在保留文件结构的同时重定向URL以分离主机

时间:2011-10-07 01:17:47

标签: php apache mod-rewrite redirect

我拥有theone.com和twosies.com。我把我的托管捆绑了两个。

我的网站位于twosies.com/theone /

并通过twosies.com/theone/home.php

获取

我想通过theone.com/home.php

访问该网站

我该怎么做? 我之前使用过htaccess,但只是为了简化页面查询和删除文件扩展名。

问候

-Taylor

*修正了一个拼写错误

2 个答案:

答案 0 :(得分:0)

您不需要mod_rewritephp,一个简单的Redirect可以做到这一点:

Redirect /service http://foo2.example.com/service

检查链接是否有详细信息。

答案 1 :(得分:0)

<?php
function Redirect($path){
          ?>
          <script language="javascript" type="text/javascript">
                window.location = "<?php echo $path; ?>";
          </script>
          <?php
          }
?>