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

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

Post by ggrant3 » Mon Sep 08, 2025 6:28 am

by mona wrote:
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 .
Ah, I did not know that. So then I might have screwed things up by using 301's?

I upgraded from 1.5.5.1 and couldn't get my old SEO package to work, so I got another one. Now I'm running around chasing brokwn url's and things have become a mess.

I'm getting broken url's and I am wondering if it's because the two different seo extensions (the one from my old OC 1.5.5.1 & the new one from my OC 3.0.4.1) are doing thins differently. Because the new one changed the title of my products slightly and it's causing broken links.

I did have an extension that must have added the .html to the end of some url's, not sure why. So I ended up just modifying my old htaccess file and redirecting the old page url's to the new page url's.

But I use the

Code: Select all

Redirect 301 "/store/product1" http://www.xyz.com/store/newproduct1
style rule, not the style you showed above.

So in those cases I should still use 302 instead?

New member

Posts

Joined
Fri May 02, 2014 10:52 pm

Post by by mona » Mon Sep 08, 2025 3:17 pm

ggrant3 wrote:
Mon Sep 08, 2025 6:28 am
Ah, I did not know that. So then I might have screwed things up by using 301's?
301 is PERMENENT :: 302 is TEMPORARY
It does not "screw things up" totally - but takes a long time to fix - the most damaging is google - if it sees a 301 it will change it without coming back as it would for a 302.
ggrant3 wrote:
Mon Sep 08, 2025 6:28 am
I upgraded from 1.5.5.1 and couldn't get my old SEO package to work, so I got another one. Now I'm running around chasing brokwn url's and things have become a mess.

I'm getting broken url's and I am wondering if it's because the two different seo extensions (the one from my old OC 1.5.5.1 & the new one from my OC 3.0.4.1) are doing thins differently. Because the new one changed the title of my products slightly and it's causing broken links.
You should not have had to change your urls - even with a new seo package - I suspect you ran it to change them - if google was happy with your urls in 1.5.5.1 why would you change them? It is messy but ideally you want the ones google already had unless for some reason you really dont. Also depends on how many products? You should be able to define how to generate the SEO friendly urls to fix it ?


ggrant3 wrote:
Mon Sep 08, 2025 6:28 am
But I use the

Code: Select all

Redirect 301 "/store/product1" http://www.xyz.com/store/newproduct1
style rule, not the style you showed above.

So in those cases I should still use 302 instead?
yes 302 until you have checked they are correct ALWAYS.

from a page on the current site, to another page on the same site.

Code: Select all

Redirect 302 "/old-page.html" "/new-page"
This is for if the new page is located at another domain

Code: Select all

Redirect 302 "/old-page.html" "https://www.new.com/new-page"
You change the 302 to a 301 AFTER it is has been checked and you are not going to change it again.

You might be better with a redirect extension - I can recommend Jonathan's - https://www.getclearthinking.com/redirect-manager

ALSO - you have put http - one of the most important SEO areas is https - security is a bigger SEO issue than urls

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 ggrant3 » Mon Sep 08, 2025 10:16 pm

by mona wrote:
Mon Sep 08, 2025 3:17 pm

301 is PERMENENT :: 302 is TEMPORARY
It does not "screw things up" totally - but takes a long time to fix - the most damaging is google - if it sees a 301 it will change it without coming back as it would for a 302.
by mona wrote:
Mon Sep 08, 2025 3:17 pm
You should not have had to change your urls - even with a new seo package - I suspect you ran it to change them - if google was happy with your urls in 1.5.5.1 why would you change them? It is messy but ideally you want the ones google already had unless for some reason you really dont. Also depends on how many products? You should be able to define how to generate the SEO friendly urls to fix it ?
Just to clarify more,

No, I did not change the url's or want google to change them.
I did not physically change the product names/titles, but here is an example of what changed.
OC 1.5.5.1 url - www.mysite.com/store/L-Glutamine-3-bottle.html
OC 3.0.4.1 url - www.mysite.com/store/L-Glutamine-3-bottles.html (an s was added onto bottle)

I don't know if this new SEO extension maybe took info from a different area to get it's info for the url, but I did not change anything. Once I caught onto that issue, I went into the SEO tab of each product to fix it back to the original (non-plural) version and created a 301 redirect for the (bad) plural url (OC 3.0.4.1 url - www.mysite.com/store/L-Glutamine-3-bottles.html) to go back to the original (www.mysite.com/store/L-Glutamine-3-bottle.html), <--- (without the plural for bottle)

I installed a broken link extension, which is what brought this issue to my attention. The SEO extension changed all of my other pages url's to a slightly different version also. So again, I went into the SEO tab of all my pages, like my information pages, and put the SEO tab back to what the old (OC 1.5.5.1) url was for the page. And then in my htaccess file, I did a 301 redirect to redirect the new/bad url's to the original url's (that are now once again being used via the SEO tab).

So in that case, didn't I do the right thing, by redirecting (permanently) the new/bad url's to go back to the original url's, I don't want that to be a temporary fix, they never should have appeared in the first place



by mona wrote:
Mon Sep 08, 2025 3:17 pm

yes 302 until you have checked they are correct ALWAYS.

from a page on the current site, to another page on the same site.

Code: Select all

Redirect 302 "/old-page.html" "/new-page"
This is for if the new page is located at another domain

Code: Select all

Redirect 302 "/old-page.html" "https://www.new.com/new-page"
Okay, so no need for the extra portion I was putting in, since they are on the same domain. Is it a minor issue or should I change all of them?


by mona wrote:
Mon Sep 08, 2025 3:17 pm
ALSO - you have put http - one of the most important SEO areas is https - security is a bigger SEO issue than urls
I was using this in my htaccess file to force https on all pages already

Code: Select all

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

Just because the very old 301 redirect's were before the https suggestion/requirement was in force or highly suggested. And to ensure all pages are always secure. I could have added the "s" in the new 301's but just figured it didn't matter since the pages were being forced to https anyways.

New member

Posts

Joined
Fri May 02, 2014 10:52 pm

Post by by mona » Mon Sep 08, 2025 10:53 pm

permanent is PERMANENT - if you make a mistake - it is PERMANENT -
Everyone makes mistakes - so you do not make it permanent until it has been TESTED. once it is TESTED and you are SURE - then you change it to permanent - until then you use 302

In the SEO url tab of product pages there is a SEO url - I dont know what extension you use - nor does it matter - it should not have changed your SEO urls but adding a s or a 1 or en - may be becasue it found the old one and created a new one so there are no duplicates . it would be MUCH quicker to fix your SEO urls from an old sitemap than redirects . AND if you did this the redirect - well they should not be necessary - but now you are suggesting that you are redirecting from poor SEO extension urls to the original urls that you manually changed - all of this feeds into why you do not use 301 -
Is it a minor issue or should I change all of them?
It is a major issue - change
I was using this in my htaccess file to force https on all pages already
- and now you are telling it to redirect and redirect again - depending on the order - possibly getting yourself into an endless loop, but either way REALLY BAD

htaccess is not really for newbies - which means - if it is in htaccess - BE CAREFUL

Just becasue you get access to something does not mean that you can just "play around" and not expect something bad to happen.
htaccess is not an interface - it is a very specific importnat file that talks to the server - so you are directing your server - think about that for a moment -
copy and paste the wrong thing from the internet and - it can tell your server to do anything - so pelase be careful with the logic "that didnt think it matters" - if it is not a setting in admin - it matters - always -

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 gogoweb » Tue Sep 09, 2025 1:00 am

OK, here is what I would do:
Restore a full backup of the old site - to a subdomain or subfolder.
Run a full crawl of the site with something like Xenu.
get a url list in a text file of all working crawled html urls, replace subdomain with live domain in the text file.
Keep that for future reference.

In the new installation:
- There are a few things to consider after looking at the list of old urls:
1 - Example product old url: oldsite.com/store/fashion/men/super-green-shirt.html
Can you access any of these (without 404) on live site:
newsite.com/store/fashion/men/super-green-shirt
newsite.com/store/super-green-shirt
newsite.com/super-green-shirt
In the eyes of google the above 3 will always resolve to /super-green-shirt - this been (should be) the canonical url.
Same goes for all seo urls - category, info, manufacturer etc.

If the above works and you are able to pinpoint old to new relations then its a matter of htaccess rewriting or a bit of $_GET['_route_'] rewriting.

If it does not work, then you need to look into the seo_url (new) vs url_alias (old) tables. Forgive me for minor typos but you get the idea.
The way to "look" is something like this:
IN phpMyadmin (have both tables in one DB or allow the user of the new to access both DBs)
SELECT a.*, s.`keyword` AS new_keyword FROM url_alias AS a
LEFT JOIN seo_url AS s ON a.`query` = s.`query`

all those rows where query is like product_id/category_id and new_keyword = NULL is problem.
all those rows where query is like product_id/category_id and keyword (not equal !=) new_keyword is a fixable problem.

As final step , in index.php right on top, after <?php
add following code:
/* this rewrites
/store/fashion/men/super-green-shirt.html
to
super-green-shirt
*/
if(strpos($_GET['_route_'],'.htm')){
$last = array_pop(explode('/', $_GET['_route_']));
$_GET['_route_'] = strtr($last, array('.html'=>'', '.htm'=>''));
}

If you need more help PM me here.
ggrant3 wrote:
Mon Sep 08, 2025 6:28 am

. . .
I upgraded from 1.5.5.1 and couldn't get my old SEO package to work, so I got another one. Now I'm running around chasing brokwn url's and things have become a mess.

I'm getting broken url's and I am wondering if it's because the two different seo extensions (the one from my old OC 1.5.5.1 & the new one from my OC 3.0.4.1) are doing thins differently. Because the new one changed the title of my products slightly and it's causing broken links.

I did have an extension that must have added the .html to the end of some url's, not sure why. So I ended up just modifying my old htaccess file and redirecting the old page url's to the new page url's.

But I use the

Code: Select all

Redirect 301 "/store/product1" http://www.xyz.com/store/newproduct1
style rule, not the style you showed above.

So in those cases I should still use 302 instead?

All mods | OpenCart Bulk Related Products Ultimate Edition |GeoIP hide Prices / no add to cart by country| CSS override | Direct link to checkout / skip add to cart / buy now link | AUTO pilot - reward & purchase points


New member

Posts

Joined
Sat Oct 18, 2014 6:45 pm

Who is online

Users browsing this forum: No registered users and 55 guests