AKZN Notes

Archives for My Lazy and Forgetful Mind

WordPress Installation and Migration

Last Modified on

Force HTTPS Using htaccess on WordPress

Step 1: Update your general settings.

  • Log into your WordPress dashboard ang go to Settings > General.
  • Scroll down to the WordPress and Site URL Address field and replace the HTTP with HTTPS.

Replacing HTTP with HTTPS for the WordPress and Site URL Address in WordPress dashboard

  • Click the Save Changes button at the bottom of the page. You’ll be automatically logged out of your dashboard and have to log back in.

step 2: edit .httacess on worpress root folder

  • add this line after # END WORDPRESS
    RewriteCond %{SERVER_PORT} 80
    RewriteRule ^(.*)$ https://www.domainanda.com/$1 [R,L]

if Custom Permalink Not Working

add rewrite engine rule on apache2.conf
sudo nano /etc/apache2/apache2.conf

add this line below directory section

<Directory /path/to/site>
     #add the following setting to allow .htaccess in your web dir to work
     AllowOverride FileInfo

     #other settings ---

</Directory>

install/update WordPress plugins without providing FTP access

add this to your wp-config.php file:

define('FS_METHOD', 'direct');

this line is required on Woongkir Plugin on VPS deployment in you are not using FTP

Update failed fix hack

add this to .htaccess

php_value max_execution_time 300

Upload image failed fix

# Give Ownership To www-data  
chown -R www-data:www-data /var/www  

# Correct Directory Permissions  
find /var/www -type d -exec chmod 0755 {} \;  
# Correct Files Permissions  
find /var/www -type f -exec chmod 0644 {} \;  

Leave a Reply

Your email address will not be published.