略過並前往主要內容
致電我們
服務專線和服務時間
預約回電

無須線上等候,提交預約我們將儘快回電。

預約回電
說明中心

瀏覽我們線上說明資源

說明

Linux Hosting (cPanel) 說明

Redirect my cPanel website to HTTPS

After your SSL certficate is installed on your Linux Hosting account, there are some modifications you'll need to make to your .htaccess file. Adding a few lines to your .htaccess file will automatically redirect your visitors to the HTTPS version of your website.

Note: These instructions don't apply to WordPress installed on cPanel. For those steps, see Redirect my WordPress website to HTTPS for Linux Hosting

  1. Go to your GoDaddy product page.
  2. Under Web Hosting, next to the Linux Hosting account you want to use, click Manage.
    click manage
  3. In the account Dashboard, click File Manager.
    select file manager
  4. In the cPanel File Manager, click Settings.
  5. Make sure that Show Hidden Files (dotfiles) is checked, and click Save.
  6. Click on public_html, and open your .htaccess if you already have one. If not, click File+, name the file .htaccess and click Create New File.
  7. Select the .htaccess file, and click Edit.
    • If you just created your .htaccess file, use the following code to set up the URL redirect to the HTTPS version of your website:
      RewriteEngine On 
      RewriteCond %{SERVER_PORT} 80
      RewriteCond %{HTTP_HOST} ^(www\.)?coolexample\.com
      RewriteRule ^(.*)$ https://www.coolexample.com/$1 [R,L]
      

    • If your .htaccess file already exists in your hosting account, do not duplicate ReWriteEngine On. Insert the lines that begin with ReWriteCond and RewriteRule directly after the already existing ReWriteEngine On.
    • Required: You need to replace coolexample.com with your domain name for the sample code to work.
  8. Click Save Changes and Close. That's it!

Visit your website and you'll automatically be re-directed to the HTTPS version.

We provide these instructions as a courtesy, but you may need to make other changes to get the redirect working if you already have a .htaccess file.

Note: Need help from a GoDaddy Guide? On our Contact Us page, click Chat Now for guidance 24/7.

More info

相關社群

bestpainter's Avatar
Can't force HTTPS: Too Many Redirects

6 回覆

Last posted almost 2 years ago.

jseg's Avatar
Redirect website to HTTPS in cPanel/Linux

1 回覆

Last posted almost 3 years ago.

nt123's Avatar
https to https redirect

3 回覆

Last posted almost 4 years ago.

IMC_DI's Avatar
Redirect https://www to https://

2 回覆

Last posted over 1 year ago.

找不到主題嗎?搜尋社群