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
Online

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

Posts

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

Users browsing this forum: No registered users and 31 guests