Wordpress: Difference between revisions

From SWKLS WIKI
Jump to navigation Jump to search
(Created page with "==Server Side== ===Common Error Fixes=== Ensure that the folder owner & group for the website is correct <syntaxhighlight lang="Bash" line start="1"> ls -la /var/www/html/ </s...")
 
No edit summary
 
Line 5: Line 5:
ls -la /var/www/html/
ls -la /var/www/html/
</syntaxhighlight>
</syntaxhighlight>
<blockquote style="color:#428bca;background:#ebf3f9;border-left:5px solid #428bca;padding:12px;margin:0px;>(should be ec2-user:apache)</blockquote>
<blockquote class="inform">(should be ec2-user:apache)</blockquote>


If not, change it:
If not, change it:
Line 16: Line 16:
</syntaxhighlight>
</syntaxhighlight>
===MySQL Replace HTTP with HTTPS===
===MySQL Replace HTTP with HTTPS===
<blockquote style="color:#428bca;background:#ebf3f9;border-left:5px solid #428bca;padding:12px;margin:0px;>Reference: https://www.bram.us/2014/12/06/migrating-your-wordpress-website-from-http-to-https/</blockquote>
<blockquote class="inform">Reference: https://www.bram.us/2014/12/06/migrating-your-wordpress-website-from-http-to-https/</blockquote>


To modify all posts to reflect https for a given domain:
To modify all posts to reflect https for a given domain:

Latest revision as of 16:49, 3 April 2020

Server Side

Common Error Fixes

Ensure that the folder owner & group for the website is correct

ls -la /var/www/html/

(should be ec2-user:apache)

If not, change it:

chown -R /var/www/html/<site_name>

Edit wp-config file to include:

define('FS_METHOD', 'direct');

MySQL Replace HTTP with HTTPS

Reference: https://www.bram.us/2014/12/06/migrating-your-wordpress-website-from-http-to-https/

To modify all posts to reflect https for a given domain:

mysql -u <user> -p
show databases;
use <database_name>;
UPDATE wp_posts SET post_content = REPLACE(post_content, 'http://kinsleylibrary.info', 'https://kinsleylibrary.info');
UPDATE wp_options SET option_value = REPLACE(option_value, 'http://', 'https://');


Other commands for reference:
show tables;
show columns from <table_name>;