【问题标题】:.htaccess redirect request to subdomain subfolder with ssl.htaccess 使用 ssl 将请求重定向到子域子文件夹
【发布时间】:2017-03-06 23:34:58
【问题描述】:

我想将所有请求从 http://sub.domain.com 重定向到 https://sub.domain.com/en/

例如,访问http://sub.domain.com/test的客户将通过htaccess规则重定向到https://sub.domain.com/en/test/

完成这个需要什么规则?

【问题讨论】:

    标签: apache .htaccess redirect ssl subdomain


    【解决方案1】:

    这样试试吧,

    RewriteEngine on
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ https://sub.domain.com/en/$1 [R=301,L]
    

    【讨论】:

      猜你喜欢
      • 2012-01-09
      • 2012-11-23
      • 2017-03-05
      • 2013-11-08
      • 1970-01-01
      • 2014-03-17
      • 1970-01-01
      • 2016-02-08
      • 1970-01-01
      相关资源
      最近更新 更多