Post by ggrant3 » Thu Aug 28, 2025 8:20 pm

So my old site was OC 1.5.5.1 and now is OC 3.0.4.1

I'm seeing a lot of "The page you requested cannot be found!" error landing pages.

What I think is the issue is that the old site had .html at the end of a lot of pages and the new version of OC has done away with that.
Am I right? (Example: old opencart version url - www.mysite.com/store/benefits.html | new opencart version url: www.mysite.com/store/benefits)

I tried redirecting those pages with code in the htaccess file (the htaccess file in my /store file, since my store is in the /store directory)

I looked at the original rewrite code:

Code: Select all

## SEO URL Settings
RewriteEngine On
# If your opencart installation does not run in the main web folder make sure the following is set to the folder it does run in, i.e. / becomes /shop/
RewriteBase /store/
RewriteRule ^sitemap.xml$ index.php?route=extension/feed/google_sitemap [L]
RewriteRule ^googlebase.xml$ index.php?route=extension/feed/google_base [L]
RewriteRule ^system/storage/(.*) index.php?route=error/not_found [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !.*\.(ico|gif|jpg|jpeg|png|webp|js|css)
RewriteRule ^([^?]*) index.php?_route_=$1 [L,QSA]
and changed it to:

Code: Select all

# SEO URL Settings
RewriteEngine On
# If your opencart installation does not run in the main web folder make sure the following is set to the folder it does run in, i.e. / becomes /shop/
RewriteBase /store/
RewriteRule ^sitemap.xml$ index.php?route=extension/feed/google_sitemap [L]
RewriteRule ^googlebase.xml$ index.php?route=extension/feed/google_base [L]
RewriteRule ^system/storage/(.*) index.php?route=error/not_found [L]
# Redirect .html to extensionless URLs
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^store/(.+)\.html$ /store/$1 [R=301,L]
# General OpenCart SEO URL rule
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !.*\.(ico|gif|jpg|jpeg|png|webp|js|css)
RewriteRule ^([^?]*) index.php?_route_=$1 [L,QSA]
But I still get the blank OC page saying "The page you requested cannot be found!"

So, I'm guessing I did not do it correctly. So I figured I would come here and see if anyone knows a different/better way to accomplish this.

Disclaimer, I am using Cloudfare, but I paused it during this attempt. And also tried using incognito mode

New member

Posts

Joined
Fri May 02, 2014 10:52 pm

Post by khnaz35 » Fri Aug 29, 2025 12:14 am

Can you tell us how did you made a upgrade?

Got a burning question at 3 AM that even Google shrugs at? There’s a not-so-secret inbox that might just have your answer: khnaz35@gmail.com
Breathe in some nature while you're at it. It’s cheaper than therapy. :-*

Feel free to sling a bear my way via PayPal @ khnaz35@gmail.com


User avatar
Active Member

Posts

Joined
Mon Aug 27, 2018 11:30 pm
Location - Malaysia

Post by by mona » Fri Aug 29, 2025 12:55 am

try

Code: Select all

RewriteRule ^(.*)\.html$ /$1 [L,R=302]
and do not use 301 until it is correct - now you might have a bit of an issue because your 301 is permanent .

DISCLAIMER:
You should not modify core files .. if you would like to donate a cup of coffee I will write it in a modification for you.


https://www.youtube.com/watch?v=zXIxDoCRc84


User avatar
Expert Member

Posts

Joined
Mon Jun 10, 2019 9:31 am

Post by paulfeakins » Fri Aug 29, 2025 11:07 pm

by mona wrote:
Fri Aug 29, 2025 12:55 am
and do not use 301 until it is correct - now you might have a bit of an issue because your 301 is permanent .
Can be annoying to clear that from the browser cache I think.

UK OpenCart Hosting | OpenCart Audits | OpenCart Support - please email info@antropy.co.uk


User avatar
Legendary Member
Online

Posts

Joined
Mon Aug 22, 2011 11:01 pm
Location - London Gatwick, United Kingdom

Post by Elevate » Tue Sep 02, 2025 11:18 pm

ggrant3 wrote:
Thu Aug 28, 2025 8:20 pm
So my old site was OC 1.5.5.1 and now is OC 3.0.4.1
I don't recall any of the 1.5x Opencart versions using .html on the end of the URL

Have you tried a default .htaccess file without any custom rules?

ELEV8TE Website Development
Available for hire - please contact me at https://www.elev8tewebsitedevelopment.com/contact
https://www.elev8tewebsitedevelopment.com


User avatar
Active Member

Posts

Joined
Fri Jul 06, 2018 12:40 am
Location - Denver, Colorado, USA

Post by by mona » Wed Sep 03, 2025 12:13 am

Elevate wrote:
Tue Sep 02, 2025 11:18 pm
I don't recall any of the 1.5x Opencart versions using .html on the end of the URL
That is correct and theoretically it should make no difference anyway, but google indexing might.
Note: I have seen a few sites even today using html at the end using OC3 .. SEO modules .

Using html at the end of product pages should not make any difference - also this is benefits.html which also suggests it is not a product, but possibly custom pages - maybe info pages.

I agree with your suggestion to check without anything in htaccess also- and making sure the 301 has cleared - whether it has been removed or not - before testing.

DISCLAIMER:
You should not modify core files .. if you would like to donate a cup of coffee I will write it in a modification for you.


https://www.youtube.com/watch?v=zXIxDoCRc84


User avatar
Expert Member

Posts

Joined
Mon Jun 10, 2019 9:31 am

Post by Elevate » Thu Sep 04, 2025 12:18 am

OP must have had an extension to add .html for the old store URLs

ELEV8TE Website Development
Available for hire - please contact me at https://www.elev8tewebsitedevelopment.com/contact
https://www.elev8tewebsitedevelopment.com


User avatar
Active Member

Posts

Joined
Fri Jul 06, 2018 12:40 am
Location - Denver, Colorado, USA
Who is online

Users browsing this forum: No registered users and 32 guests