Setting a Custom 404 Page with htaccess

I bought a custom HTML website template with a 404.html page. How do I use it? If I enter a wrong website address I don’t see the 404 page my browser simply shows a generic message from the hosting control panel. The server needs to be configured to tell it […]

htaccess Difference Between Files and FilesMatch

Whilst writing the two recent articles about blocking xml-rpc access and the matching of files in htaccess. .htaccess uses Files and FilesMatch to control access to files. For example for the single file wp-config.php <Files “wp-config.php”> Order Allow, Deny allow from all deny from 192.0.2.52 </Files> There’s also <FilesMatch “\.(gif|jpe?g|png)$”> […]

Blocking xml-rpc Access

I’ve heard that I should disable xml-rpc on a WordPress website. Why should I disable it and how? XML-RPC What is it? And how to Disable. What is xml-rpc? This is the connection for the WordPress API interface. It allows apps such as the WordPress app on an iPhone or […]

WordPress Redirect to https

Your WordPress website was running as a traditional unsecured site. Now to meet the search engine guidelines you have added a certificate and encrypted the website. But the old unencrypted website address is still accessible. This isn’t good for SEO with effectively two websites with the same content. How to […]

Redirect www and non-www Using .htaccess File

Non-www URLs can be redirected to www URLs using the .htaccess file. To re-write the website URL from non-www to www the .htaccess file is edited and the rewrite rules added. The Apache mod-rewrite module will be used to perform the rewriting of the website URL. The RewriteEngine is turned […]

Exclude Page from 404 Redirect

A page or directory can be excluded from the WordPress redirect with an amendment of the .htaccess file. By default pages WordPress owns the directories and files of a website instance. If a page or directory is not known to it then a redirect is given to a 404 page. […]