2009-08-01 11 views
2

私はhttp://www.example.com/client にあるクライアントフォルダを持っていますが、今はサーバーにSSLをインストールしました.HTACCESSを使用して永続的なリダイレクトを追加して、/クライアントにアクセスしたときに、 〜へ:https://www.example.com/client.htaccess内のRewriteCondとRewriteRule

誰でもその方法を知っていますか?

私はこのように、過去に自分のドメインをリダイレクトしました:のためならば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] 

これは解決策に影響はありませんが、サイトはまだFIRST www.example.comにリダイレクトする必要があります。また、例:http://www.example.co.za/clientと入力します。

+0

可能な重複:http://stackoverflow.com/questions/1213404/using-htaccess-to-control-https-on-certain-pages/1214288#1214288 – Gumbo

答えて

1

これを試してみてください:

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

RewriteEngine でのRewriteRule ^/$ https://www.example.com/client [301、NC、L] URLはhttps://www.example.comかのいずれかでスラッシュである時はいつでも

は、それは、Apacheに伝え、?終了すると、ur/clientにリダイレクトされます