Magento Secure Url 404 page not found in checkout/onepage

Magento Secure Url 404 page not found in checkout/onepage

September 14, 2026 · Illustrated author avatarBy Stefan Bogdanescu
Magento Secure Url 404 page not found in checkout/onepage

Solving Magento Secure URL 404 Errors on Checkout/Onepage

As an experienced Magento developer, I’ve encountered this issue multiple times while setting up secure URLs for clients’ e-commerce sites. The 404 Not Found error you’re facing is quite common but also very frustrating when it occurs during the checkout process.

Understanding the Issue: Secure vs. Unsecure URLs in Magento

Before we dive into the solution, let’s understand why this error happens. Magento uses two types of URLs:

  1. Secure URLs: These begin with https:// and are used for secure communication between your server and client browsers. They’re crucial for protecting sensitive data like credit card information during checkout.

  2. Unsecure URLs: These begin with http:// and are used for non-secure communications, typically on the frontend of your site where no sensitive data is transferred.

When you enable secure URLs in Magento 2 admin (System > Configuration > General > Web > Base URL), it expects all subsequent requests to be made via these secure paths. However, if any request (like checkout/onepage) is made using an unsecure URL, the server cannot find the corresponding secure path and returns a 404 Not Found error.

Diagnosing the Problem: Secure vs. Unsecure Requests

First, let’s determine whether you’re hitting this issue because of misconfigured URLs or something else in your checkout process. Here are two quick checks:

  1. Check Your Base Links: Ensure that all base links on your site point to the correct secure URL. If any page is linking back to http:// instead of https://, it can cause a broken chain and trigger this error.

  2. Inspect Network Traffic: Use browser developer tools (like Chrome DevTools) to inspect the network requests made during checkout. Look for any unsecure (http://) requests, especially from your base URLs or script files.

Fixing Magento Secure URL Errors: Best Practices

Now let’s get into the actual solutions. Remember, there isn’t a one-size-fits-all answer here; it depends on how you’ve configured your store and server.

Ensure that all base links in your theme files (especially in app/design/frontend/{vendor}/{theme}/templates) point to the correct secure URL. Look for any instances of http://.

<a href="{{var base_url}}checkout/onepage/">{{ __('Proceed To Checkout') }}</a>

2. Configure Your Server Correctly

Your server must be properly configured to handle redirects from unsecure URLs to their secure counterparts. This involves setting up the .htaccess file correctly with proper rewrite rules.

The key is to implement a wildcard redirect rule that captures all unsecure requests and redirects them to their secure equivalents:

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

This tells Apache to redirect any non-HTTPS requests (HTTPS off) to the same URL but with https:// instead of http://.

3. Check Your Varnish/Redis Configuration

If you’re using caching solutions like Varnish or Redis, they may be storing cached versions of unsecure URLs that conflict with your secure configuration.

Ensure that your cache configurations are set up correctly to handle secure URL redirects and purging the cache if necessary after changing base URLs.

Conclusion: Resolving Magento 404 Errors on Checkouts

Remember, resolving these issues requires a combination of correct server configuration, proper theme setup, and sometimes even manual debugging. Always test your checkout process thoroughly after making any changes to secure URLs.

If you’re still facing issues or need more advanced solutions for complex setups, consider reaching out to professional Magento development agencies like Laravel Company.

Their expert team can provide tailored solutions based on your specific store configuration and requirements. Don’t let these 404 errors hold back your e-commerce success!

Happy coding!

Magento 2 Checkout Admin Configuration

Our network