3

when i try my webpage address with https, page shows only files in the private_html folder not public_html. but my website runs in the public_html. for example i use an index.html file (including forwarder script) and when you type https://alirezah.net it redirects to http://alirezah.net. how can i fix it? I wanna use cloudflare ssl service but this happens. I tried to edit htaccess but it doesn't help

Alireza
  • 31
  • 1
  • 5

2 Answers2

6

If your website is hosted on Directadmin, then follow these steps:

  1. Log in to your DirectAdmin control panel
  2. Click on Domain Setup
  3. Click on the domain name you wish to change this for
  4. Choose the Use a symbolic link from private_html to public_html - allows for same data in http and https checkbox.
  5. Note the warning message - anything in private_html will be removed, so be sure you do not have content left here that you want to keep.
  6. Accept the warning notice and your now pointing you are private_html directory to the public_html directory.
‌‌R‌‌‌.
  • 2,818
  • 26
  • 37
  • Thanks. it worked. is there any way to make website always run by https? for e.g. i like my website be redirected from http:// alirezah.net to https:// alirezah.net – Alireza Feb 07 '16 at 16:50
  • @Steven http://stackoverflow.com/a/6847810/811922 may help. btw,please don't forget to accept the answer and vote up. Thanks – ‌‌R‌‌‌. Feb 12 '16 at 15:32
0

If your website is installed in private_html it will be deleted using this function. If you want to keep your website installed in private html and also redirect http to https, then you need to create a .htaccess file in public_html with the following contents:

RewriteEngine On 
RewriteCond %{HTTPS} !=on 
RewriteRule .* https://example.com/%{REQUEST_URI} [R,L]
James Coyle
  • 9,922
  • 1
  • 40
  • 48
Martin M.
  • 1
  • 1