i want to redirect these sub domains and main domain from http to https and sub blogs too.

Home directories

WWW (Wordpress): /home1/placehq5/public_html/.htaccess My Somadome (PHP): /home1/placehq5/public_html/my Kiosk site (HTML): /home1/placehq5/public_html/kiosk Config Webserver is Apache version 2.2.31 (on Linux)

please correct this htaccess file.

RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://somadome.com/$1 [L,R=301]

RewriteCond %{SERVER_PORT} 443
RewriteCond %{HTTP_HOST} ^www[.].+$
RewriteRule ^(.*)$ https://somadome.com/$1 [L,R=301]

in this picture first column is how my urls are right now, 2nd column is what i want after htaccess rules, 3rd coulmn is what iam getting after applying these rule below:- enter image description here


Add this to apache config and you will have redirect of all web sites which do nto use https to ssl/tls

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{SERVER_NAME}/$1 [R,L] 
  • its shared server hosting , cant edit httpd.conf file, dot have access to it. :( can you write rule iin htaccess file ? – Navdeep.D2 May 8 '17 at 20:07
  • In such case add this .htaccess in every directory you have – Romeo Ninov May 9 '17 at 3:40
  • okay , i will try this. "In such case add this .htaccess in every directory you have" – Navdeep.D2 May 9 '17 at 18:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.