Bỏ qua đến nội dung chính
Gọi cho chúng tôi
Số điện thoại và giờ làm việc
Trung tâm Trợ giúp

Khám phá các tài nguyên trợ giúp trực tuyến của chúng tôi

Trợ giúp

GoDaddy Trợ giúp

Redirect my WordPress website to HTTPS for Linux Hosting

After your SSL certificate is installed on your Linux Hosting account, there are some modifications you'll need to make to your .htaccess file to automatically redirect your visitors to an HTTPS version of your WordPress website.

Note: These instructions don't apply to Managed WordPress accounts with an SSL certificate. We'll take care of the HTTPS redirect automatically (after the certificate install is complete).

  1. Log into your WordPress Dashboard.
  2. Hover over Settings on the left navigation panel, then select General.
  3. Locate the following fields on the new page:
    • WordPress Address (URL)
    • Site Address (URL)
  4. In each field, update your URLs to include https instead of http.
    • For example, http://coolexample.com would become https://coolexample.com.
  5. Scroll down to the bottom of the page and select Save Changes.
  6. Open your current .htaccess file in the /public_html/ folder with the cPanel file manager for editing. If you don't already have a .htaccess file, you'll need to create one.
  7. Insert the following code at the top of your .htaccess file:
  8. # BEGIN GD-SSL
    <span/>IfModule mod_rewrite.c>
    Options +FollowSymLinks
    RewriteEngine On
    RewriteCond %{HTTPS} !=on
    RewriteCond %{HTTP_USER_AGENT} ^(.+)$
    RewriteCond %{SERVER_NAME} ^coolexample\.com$ [OR]
    RewriteCond %{SERVER_NAME} ^www\.coolexample\.com$
    RewriteRule .* https://%{SERVER_NAME}%{REQUEST_URI} [R=301,L]
    Header add Strict-Transport-Security "max-age=300"
    <span/>/IfModule>
    # END GD-SSL
    
    # BEGIN WordPress
    <span/>IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    <span/>/IfModule>
    # END WordPress
  9. Select Save Changes at the top-right corner of the screen.

More info

Liên quan đến cộng đồng

natali_'s Avatar
Free SSL installed but not working. ???

1 Câu trả lời

Last posted about 1 year ago.

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

1 Câu trả lời

Last posted almost 3 years ago.

rwcomporta's Avatar
Purchased premium dns from godaddy and now website is down?

6 Câu trả lời

Last posted 4 months ago.

416serg's Avatar
Godaddy workspace email & Wordpress Contact Form 7

1 Câu trả lời

Last posted almost 3 years ago.

Không tìm được thông tin mà bạn muốn tìm kiếm? Tìm kiếm trong Cộng đồng