【发布时间】:2010-11-16 00:13:10
【问题描述】:
我有一个位于http://www.example.com/client 的客户端文件夹 但是,我现在已经在服务器上安装了 SSL,并希望使用 HTACCESS 添加一个永久重定向,以便每当访问 /client 时,它都会重定向到:https://www.example.com/client
有人知道怎么做吗?
我过去曾像这样重定向我的域:
RewriteCond %{HTTP_HOST} ^example\.com$ [NC]
RewriteRule ^(.*)$ http://www.example.com/$1 [L,R=301]
RewriteCond %{HTTP_HOST} ^www.example\.com$ [NC]
RewriteRule ^(.*)$ http://www.example.com/$1 [L,R=301]
这应该不会影响解决方案,但站点仍必须先重定向到 www.example.com,然后再重定向到 https://www.example.com/client,例如输入 http://www.example.co.za/client。
【问题讨论】:
标签: apache .htaccess mod-rewrite