【问题标题】:internal redirect in mod_rewritemod_rewrite 中的内部重定向
【发布时间】:2012-05-27 15:12:32
【问题描述】:

我有一个在 webhotel 上运行的小型 web 应用程序。我想将不同的版本放在不同的文件夹中。例如:

html/v1/index.php
html/v2/index.php

如何以用户永远看不到版本文件夹的方式提供页面。例如,他们只会看到 domain.com/index.php

我尝试了 .htaccess mod_rewrite 但它似乎也更改了浏览器 URL。

【问题讨论】:

    标签: .htaccess mod-rewrite


    【解决方案1】:
    RewriteEngine On
    RewriteCond %{REQUEST_URI} !(.*)html/v1(.*)
    RewriteRule (.*) html/v1/$1 [NC,L]
    

    这会将所有内容重定向到 v1 文件夹而不更改 URL

    【讨论】:

      猜你喜欢
      • 2015-01-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-10-03
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多