【问题标题】:Complex redirect with Apache使用 Apache 进行复杂的重定向
【发布时间】:2016-10-17 16:21:06
【问题描述】:

如何重定向

  • osite.com
  • en.osite.com
  • ru.osite.com/product/1

和其他不同的子域分别去

  • so.kr/index.php?url=site.com
  • so.kr/index.php?url=en.site.com
  • so.kr/index.php?url=ru.site.com/product/1

在阿帕奇? 这是对site.com 的便捷链接缩短的需要。 提前致谢。

【问题讨论】:

    标签: apache .htaccess yourls


    【解决方案1】:

    我不明白,但它有效。

    RewriteEngine on
    
    RewriteCond %{HTTP_HOST} ^([\w\d]+)\.osite\.ru$
    RewriteRule ^(.*)$ http://so.kr/index.php?url=http://%1.site.ru$1 [NC,L,QSA]
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-01-15
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多