How to setup Wordpress to use HTTPS connection ?


最后修订日期: 2022-06-24
Applicable Products:
  • Wordpress
  • QTS 5.0 or later

After installing WordPress in App center, HTTP connection is used by default. If you want to access WordPress via HTTPS connection, you need to manually modify the configuration file of WordPress.

  1. Refer to the link below to locate the configuration files of WordPress

    How do I locate the configuration files of WordPress after upgrading WordPress to 5.8.x in QTS 5.0?

    Normally the configuration files are located in /share/CACHEDEV1_DATA/.qpkg/WordPress/data/web/WordPress

  2. Follow the steps below to manually map WordPress folder in Shared Folder setting then edit/upload those files using File Station:

    1. Log in to QTS as administrator.

    2. Go to Control Panel > Privilege > Shared Folders

    3. Select Create > Shared Folder.

      1. Choose Disk Volume (for example: DataVol1 )
      2. Select Enter path manually
      3. Click the dropdown menu and locate WordPress folder (for example: /.qpkg/WordPress/data/web/WordPress )
      4. Enter the Folder Name.(for example: WordPress-web)
      5. Select “Create” .
        img
  3. Edit the configuration files by Text Editor

    1. Log in to QTS as administrator.

    2. Open App Center, install Text Editor.

    3. Open File Station

      1. Right-click wp-config.php in wordpress-web shared folder.
      2. Click Edit in Text Editor

      img

      Text Editor window opens.

      1. Locate the end of this file :/* That's all, stop editing! Happy publishing. */, before this line, add the following three lines of settings.
        Including the content of WP_HOME and WP_SITEURL.
        About the IP:Port Number, please adjust according to the NAS environment, the setting of QTS Web Server https port number.

         
        define('WP_HOME','https://172.17.34.50:8081/WordPress');
        define('WP_SITEURL','https://172.17.34.50:8081/WordPress');
        $_SERVER['HTTPS'] = 'on';

        img
        img

      2. Save the file

  4. Now, the Browser is able to WordPress by HTTPS connection.

Note: After applying this method, The HTTP connection to WordPress site will also be force redirect to HTTPS connection.

这篇文章有帮助吗?

谢谢您,我们已经收到您的意见。

请告诉我们如何改进这篇文章:

如果您想提供其他意见,请于下方输入。

选择规格

      显示更多 隐藏更多
      open menu
      back to top