RewriteCond和RewriteRule在.htaccess中

我有一个位于http://www.example.com/client的客户端文件夹但是,现在我已经在服务器上安装了SSL,并希望使用HTACCESS添加永久性redirect,以便每当/客户端被访问时,它都会redirect到: https : //www.example.com/client

任何人都知道如何做到这一点?

我像过去一样redirect了我的域名:

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] 

这应该不会影响解决scheme,但是网站仍然必须redirect到www.example.com,然后转到https://www.example.com/client ,例如http://www.example.co.za /客户端被input。

尝试这个:

 RewriteCond %{HTTPS} !on RewriteRule ^client(/.*)?$ https://www.example.com%{REQUEST_URI} [L,R=301] 

RewriteEngine On RewriteRule ^ /?$ https://www.example.com/client [301,NC,L]

它告诉apache,无论何时url是https://www.example.com或者最后都是斜杠,都会重定向到ur / client