Wordpress adding "404.html" at the end of my URLs?

Zakch93

Elite Member
Joined
Mar 7, 2020
Messages
2,307
Reaction score
855
Using Woocommerce I get this issue.

domain.com/product/{product-name}/404.html

Why is it adding the 404.html at the end? It's causing the pages to not work.
 
Up, I fixed it with this rewrite rule:

Code:
# BEGIN WordPress
<IfModule mod_rewrite.c>
 RewriteEngine On
 RewriteRule ^(wp-admin)($|/) - [L] # You don't want to mess with WordPress
 RewriteCond %{REQUEST_FILENAME} !-d
 RewriteCond %{REQUEST_FILENAME}\404.html-f
 RewriteRule .* $0.php

 # browser requests PHP
 RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /([^\ ]+)\404.html
 RewriteRule ^/?(.*)\404.html$ /$1 [L,R=301]

 # check to see if the request is for a PHP file:
 RewriteCond %{REQUEST_FILENAME}\404.html -f
 RewriteRule ^/?(.*)$ /$1404.html [L]
</IfModule>
# END WordPress

I'll appreciate it if someone could explain what causes this issue in the first place and if this is a more preferred method to solve it.
 
Back
Top