Menu Close

Change WordPress media and default URL from "http" to "https"

Despite applying 'SSL' to WordPress and completely remodeling it with the 'https' site, when I insert an image into a post within the post, such as 'Media → Library → Copy Link,' , Permalink) is sometimes set to 'http'.

In this case, if you forgot to insert 'http' and you've set all the 'SSL' security settings, your browser will recognize it as an 'incomplete secure connection page'. So you must change the first part to 'https', but it's not annoying to do this every time.

However, by modifying the WordPress 'wp-config.php' file, it is very simple and automatically recognized as 'https' and can be changed to enter. Let's change it right away.

워드프레스-미디어-및-기본-URL을-http-에서-https로-변경-change-wordpress-media-and-default-url-from-http-to-https.gif

    How to change your WordPress media and preferred URL from 'http' to 'https'

  1. Use a 'FTP' program such as Filezilla to go to a 'htdocs' path, such as '/ opt / bitnami / apps / wordpress / htdocs', based on 'AWS WordPress'.
  2. Find 'wp-config.php' file and click 'right click' → 'View / Edit (V)'. (Download, edit and upload)
  3. Find the following part of 'wp-config.php' document and modify it as follows.
  4. define('WP_SITEURL', 'http://' . $_SERVER['HTTP_HOST'] . '/');
    define('WP_HOME', 'http://' . $_SERVER['HTTP_HOST'] . '/');
    
  5. Change the 'http' part of the red part to 'https' like the blue part below.
  6. define('WP_SITEURL', 'https://' . $_SERVER['HTTP_HOST'] . '/');
    define('WP_HOME', 'https://' . $_SERVER['HTTP_HOST'] . '/');
    
  7. When editing through 'right click' → 'View / Edit (V)', pressing 'Ctrl + S' or 'save' will prompt you to apply the modifications in Filezilla. Is complete.

Once this is set once, the default site setting will be recognized as 'https' in the future, and naturally 'URL (permalink, image address)' will be entered as 'https' even when inserting images such as media. .

Comment (Information not required)

Posted in All, Wordpress

이메일 구독 - Email Subs

최선을 다해 직접 만든 콘텐츠만 공유합니다.
We share the best content we have created.