Andrew McCombe


Full Stack Web Developer

Apache: Use .htaccess to redirect non-www to www

Sometimes your website will be set up to serve your site on both www.domain.com and also domain.com. Search engines will see this as two separate sites (unless you have a rel=”canonical” tag) and this may have a negative effect on your SEO rankings. The best way to avoid this is to make sure you serve […]


Apache: Use .htaccess to redirect http to https

I’m forever having to lookup how to use Apache’s .htaccess to redirect http to https so here it is. First, make sure you have Apache’s mod_rewrite module enabled.

This will check the request for HTTPS and if it matches will permanently redirect the browser to the https:// url.


How to import a Google Sitemap into a MySQL table

Here’s a quick snippet showing how to import a Google Sitemap file into a MySQL table. This is useful if you need to do anything with the urls such as scrape the pages or check for 301/302/404 results.


Magento Admin Invalid Form Key

I Recently came across a situation where I couldn’t log in to the Magento admin area, getting ‘invalid form key on admin’. Here’s how to fix it.


How To Clear Google Chrome’s 301 Redirect Cache

Ever had a dev site set up and had it 301 redirect to ‘https’, only to find that Google Chrome caches this and you can’t get the ‘http://’ version after?


Google Analytics WordPress Plugin

This is a very basic WordPress plugin that adds Google Analytics tracking code to your WordPress Site.  It doesn’t have any advanced features like many other plugins.   Download & Installation You can get the plugin from the Github repository page here. Simply extract the zip file in your wp-content/plugins directory.  Then go to your WordPress […]


How to use htaccess to password protect your website

There are many reasons why you would want to password protect your website, or a section of your website. Here’s how to setup a .htaccess file to password protect your website.


Magento: remove admin mass action for specific role

I had a use case where a Magento admin user was limited to viewing the orders only. They should be able to view orders but not perform any actions on an order. The best way to do this with Magento is to remove admin mass actions for a specific user role.


Magento: Remove specific tabs from product edit in admin

Here’s how to remove specific tabs from Magento’s admin product edit pages.


How to upgrade Magento 2 to a later version

Here’s how to upgrade Magento 2 to a later version. For example, if you are currently running 2.1.6 and you need to upgrade to 2.1.7.