apache - HTTPS .htaccess Rewrite for parked domain -
i have 2 domain 'domain.in' , 'domain.com'. domain.in parked domain.com. have ssl domain.com need
1) if user visit www.domain.com
should redirect https://www.domain.com
2) if user visit www.domain.in
should use http.
i know can done through '.htaccess' file.
can 1 me issue ?
enable mod_rewrite , .htaccess through httpd.conf
, put code in .htaccess
under document_root
directory:
options +followsymlinks -multiviews # turn mod_rewrite on rewriteengine on rewritebase / # updated code fix. rewritecond %{https} off rewritecond %{http_host} ^(www\.)?domain\.com$ [nc] rewriterule ^ https://%{http_host}%{request_uri} [r=301,l] rewritecond %{https} on rewritecond %{http_host} ^(www\.)?domain\.in$ [nc] rewriterule ^ http://%{http_host}%{request_uri} [r=301,l]
Comments
Post a Comment