How to Fix HTTP Error 405 Method Not Allowed

When a website shows the 405 Method Not Allowed notification, it indicates a Hypertext Transfer Protocol (HTTP) error. It prevents visitors from accessing the website’s content, which can cause visitors to lose trust in your brand.

However, the notification only indicates the 405 Method Not Allowed error but does not show its cause. So, you might need to try different solutions to troubleshoot this issue.

Thus, we will share the 11 methods to fix this issue, such as reverting recent updates and checking the web server configuration.

Let’s get started with what exactly the 405 Method Not Allowed error page is.

Error code405 Method Not Allowed
Error typeClient-side error
Error variationsHTTP Error 405 – Method Not Allowed
HTTP 405 Method Not Allowed
405 Not Allowed
Method Not Allowed
HTTP Error 405
Error causesWrong URL input
Platform, theme, or plugin update issues
Compatibility issues
Database changes
Misconfigured permissions

What Is the 405 Method Not Allowed Error?

The 405 Method Not Allowed error occurs between a client and a server. This message indicates that the web server has recognized a request from a web browser to access the website but rejects the specific HTTP method.

Since the web browser cannot access the requested page, it will show an error message instead. The 405 Method Not Allowed error message is an HTTP response status code. There are different categories to indicate whether a specific HTTP request is complete:

  • 1xx status responses – informational requests.
  • 2xx status responses – successful requests.
  • 3xx status responses – redirection messages.
  • 4xx status responses – client errors.
  • 5xx status responses server errors.

So, the 405 Method Not Allowed is often caused client-side. However, it can also mean that the error is caused by web servers’ responses to clients. This client error can appear in different ways:

  • HTTP Error 405 – Method Not Allowed
  • HTTP 405 Method Not Allowed
  • 405 Not Allowed
  • Method Not Allowed
  • HTTP Error 405
The 405 Not Allowed error on a web browser.

Although the error page message may vary on different browsers, the steps to fix it are the same with any browser.

11 Methods to Fix the 405 Method Not Allowed Error

Identifying the exact cause of the 405 Method Not Allowed error can be difficult. To help you out, we have listed 11 ways to fix this HTTP issue.

1. Check the URL

One of the first solutions to fix this client-side error involves checking the Uniform Resource Identifier (URL). A common cause of the 405 Method Not Allowed error is inputting the wrong URL. As a result, the browser cannot open a page that does not exist.

Check for a missing letter or a misspelled word in the URL. Then, see if the web page loads correctly. Even though it might seem like a simple step, it often works.

2. Revert Recent Updates

In some cases, this error may start showing up after updating a site. To fix it, try reverting any recent updates you have made on your site, platform, extensions, modules, or plugins. Updates to any of these elements can cause server-side changes that lead to this error.

Each platform or application has its way of reverting recent updates. For example, WordPress users can use the WP Downgrade plugin to automatically downgrade their WordPress version and prevent irreversible changes.

To avoid this HTTP error notification lingering on your page for too long, always check your website after any updates.

3. Check for Database Changes

Another possible reason behind the 405 Method Not Allowed error is database changes. Some extensions have all privileges to access your database. Even uninstalling the extension might not revert the changes.

The steps to check the changes vary depending on the database. Hostinger users can access their database by following this guide:

  1. Head to your hPanel and click on MySQL Databases.
Choosing MySQL databases under the Databases section in hPanel.
  1. Select your site’s MySQL Database and click on the Enter phpMyAdmin button on the right.
Selecting your site's MySQL database and clicking Enter phpMyAdmin.
  1. Choose the SQL tab of your database.
Choosing the SQL tab of your database on phpMyAdmin.
  1. Run the following query, replacing dbname with your database name:
SELECT
    UNIX_TIMESTAMP(MAX(UPDATE_TIME)) AS last_update
FROM
    information_schema.tables
WHERE
    TABLE_SCHEMA = 'dbname'
GROUP BY
    TABLE_SCHEMA;
  1. Click the Go button on the right side of the page to complete the request, and it will display when you did your last database update.
Clicking the Go button on phpMyAdmin.

Search for tables and records that may have been tampered with by an extension. Revert any changes on the database.

We recommend consulting your web host’s support team to avoid making unnecessary modifications.

4. Uninstall New Plugins, Themes, and Extensions

When installing a theme, plugin, or extension, the website’s code may change. These changes can then cause the issue. So, if the error message starts appearing after you install a new plugin, theme, or extension, try uninstalling and reinstalling it again.

If you are using WordPress, then uninstalling plugins can be done by heading to Dashboard -> Plugins and Deactivating your newest plugins.

To deactivate a WordPress theme, head to Dashboard -> Appearance -> Themes. If you are using the newest theme, change it to another one first. Then, click on the new theme and select Theme Details. On the bottom right corner, click on the Delete button.

This step can also be done on your hosting account. For example, Hostinger users can disable WordPress plugins via hPanel:

  1. Head to your hPanel and go to Plugins.
Selecting Plugins on hPanel.
  1. Toggle the purple button to disable the plugin.
Disabling plugins on hPanel.

Check if the error message still appears after you disable your newest plugin or theme. If the issue is solved, try using a different extension on your site.

5. Check Your Server-Side Logs

A web application keeps server-side logs to track the different activities and events that happen on your site. Changes in the server logs can cause the 405 Method Not Allowed message to appear on your website. Look through your server logs to ensure that all information is correct.

To access a site’s server logs, head to your root directory and look for the access.log and error.log files. Check if any of the information there seems out of place.

6. Check Your Web Server Configuration

If the 405 Method Not Allowed problem persists, take a look at your server configuration files. This error indicates that the server configuration does not allow users to access a particular Uniform Resource Identifier (URI).

Check your server software to see if there are any unintentional redirects or request handling instructions. To access your configuration files, determine which server software your website uses. The two most popular ones are Apache and NGINX.

If your server is Apache, look for a .htaccess file within your website’s root directory. If your server is running on NGINX, look for an nginx.conf file. There, search for directives that are using a 405 flag. Change the files to the original data and restart your server to check if the error has disappeared.

7. Check Your Code and Scripts

Another solution to fix this error is also by checking the website’s code and scripts. Make sure that your website is using the correct coding language.

A way to check your code and scripts involves copying the website to a local development machine and performing a debugging process that simulates the exact scenario in which the 405 Method Not Allowed occurs. This way, it will be easier to detect when exactly something went wrong.

8. Fully Restore Your Website From a Backup

In some cases, the 405 HTTP error appears due to compatibility issues. If other options have not helped solve this problem, try restoring your website using the most recent backup. The steps to restore a website using a backup depend on the platform.

With Hostinger, follow the steps below to restore your website:

  1. Head to hPanel and select Backups under Files.
Selecting Backups on hPanel.
  1. Click Select under Files backups.
Clicking Select under Files backups.
  1. Select the date and click on Show files, which will load all your content from that date.
Selecting the date and clicking Show files.
  1. Navigate through the folders and select which ones to restore. Click on Restore files.
Selecting which folders to restore and clicking Restore files.
  1. Click on Restore again, and the system will start the process and send a notification once the process is complete.
Restore files? Your current website files will be deleted and restored with the files from the selected backup.

9. Check the .htaccess File

Check your .htaccess file for any entries that include 405. The 405 Method Not Allowed error message can show up on your site if you rewrite the .htaccess file incorrectly.

To investigate potential causes, go to your .htaccess file from the File Manager. Here’s how to do it if you host a WordPress site on Hostinger:

  1. Head to hPanel and go to File Manager.
Opening File Manager on hPanel.
  1. Click on the public_html folder and select the .htaccess file.
Selecting the .htaccess file on the public_html folder.
  1. Look for the lines that use Rewrite directives directing visitors to a URL. Check for [R=405].
Rewrite directives.

If it is there, add a # at the end of the line. Then, refresh your website to see if this resolves the issue.

10. Fix File Ownership

Another reason why your site may experience this HTTP method error is because of misconfigured permissions. Every file and folder on your website has a set of permissions. By fixing your file ownership, you can correct any misconfigured permissions.

There are different ways to fix file ownership depending on your platform. Follow the steps below to do so on Hostinger:

  1. Head to hPanel and click on Fix File Ownership under Other.
Selecting Fix File Ownership on hPanel.
  1. Tick the option that you want to set your site’s files and folders to default permissions and click Execute.
Clicking Execute to fix file ownership.

11. Check A Records

Finally, to solve this HTTP method problem, check your Domain Name System (DNS) records. Check the A records to make sure that all the details are correct. The A record is the most basic type of DNS record that points a domain or subdomain to an IP address.

The steps to access your DNS records depend on your web hosting provider. Hostinger users should access their database records by heading to hPanel -> DNS Zone Editor.

Opening DNS Zone Editor on hPanel.

Check that your A records contain this information:

  • Type – the type of DNS record should be A.
  • Name – use @ if the domain or subdomain name points to another IP address.
  • Points to – verify if your domain or subdomain points to the correct IP address.
  • Time to Live (TTL) – how long the DNS resolver should save the query for this domain in the cache. Most hosting providers usually set it to 14400 seconds or 4 hours.

Conclusion

The 405 Method Not Allowed error indicates that the server has received a web browser’s request but rejects the HTTP method. This prevents your visitors from seeing the website’s content.

This article shared 11 ways to fix this issue on your site:

  1. Check the URL.
  2. Revert recent updates.
  3. Check the database changes.
  4. Uninstall new plugins, themes, and extensions.
  5. Check your server-side logs.
  6. Check your web server configuration.
  7. Check your code and scripts.
  8. Fully restore your website from a backup.
  9. Check the .htaccess file.
  10. Fix file ownership.
  11. Check A records.

If none of these methods work, contact your hosting provider’s support team.

Feel free to leave a comment below with any questions, feedback, or additional tips.

Author
The author

Astari Sarosa

Astari is a Digital Content Writer at Hostinger, who is passionate about WordPress, digital marketing, and website builders. She enjoys sharing her knowledge through her writings. During her free time, Astari likes to try new activities, go on adventures, and learn about different cultures.