Post by scottyboyyy » Sun Jan 08, 2023 7:35 pm

Why do the SEO urls contain en-gb folder now?

Is there an easy way to remove this? For example:

.com/en-gb?route=common/home
.com/en-gb/catalog/desktops/pc

to just:

.com/
.com/pc

Active Member

Posts

Joined
Fri Apr 07, 2017 2:36 am

Post by JNeuhoff » Sun Jan 08, 2023 8:39 pm

Please provide more details if you want help here: OC version, extensions used, website URL

In a standard OpenCart 4 the default language isn't shown s part of the URL.

Export/Import Tool * SpamBot Buster * Unused Images Manager * Instant Option Price Calculator * Number Option * Google Tag Manager * Survey Plus * OpenTwig


User avatar
Guru Member

Posts

Joined
Wed Dec 05, 2007 3:38 am


Post by scottyboyyy » Sun Jan 08, 2023 9:41 pm

JNeuhoff wrote:
Sun Jan 08, 2023 8:39 pm
Please provide more details if you want help here: OC version, extensions used, website URL

In a standard OpenCart 4 the default language isn't shown s part of the URL.
4.0.1.1
No extensions

I created a multi store in settings, could this be the reason why it's using language in the URL?

It's also using product:

en-gb/product/tablet/samsung-galaxy-tab-10-1

I have removed the multi store and still using language, etc in url.

Active Member

Posts

Joined
Fri Apr 07, 2017 2:36 am

Post by JNeuhoff » Sun Jan 08, 2023 9:58 pm

I see, getting the same with SEO Urls enabled on the master branch.

I don't see a way to change this, unless the core gets modified to handle SEO keywords the way it used to be in OpenCart 3.

BTW.: There's still a bug in the SEO Url editor, see https://github.com/opencart/opencart/issues/12136

Export/Import Tool * SpamBot Buster * Unused Images Manager * Instant Option Price Calculator * Number Option * Google Tag Manager * Survey Plus * OpenTwig


User avatar
Guru Member

Posts

Joined
Wed Dec 05, 2007 3:38 am


Post by haydent » Thu May 04, 2023 7:10 am

any update on this, this is terrible seo practice pushing your relavant url content deeper down the tree

User avatar
Active Member

Posts

Joined
Wed Nov 09, 2011 9:50 am
Location - Sydney, Australia

Post by webocreation.com » Thu May 04, 2023 2:05 pm

Just a quick try, haven't tested a lot.

Open file /system/library/url.php and find the following code:

Code: Select all

if (!$js) {
	return str_replace('&', '&', $url);
} else {
	return $url;
}
And, replace with the following code:

Code: Select all

if (!$js) {
	return str_replace('en-gb/', '', str_replace('&', '&', $url));
} else {
	return str_replace('en-gb/', '',$url);
}
https://webocreation.com/how-to-remove- ... pencart-4/

Blog free tips and tricks
Free extensions
OpenCart Tutorials
OpenCart Tutorials Youtube Video for developers


User avatar
New member

Posts

Joined
Fri Feb 02, 2018 11:51 pm

Post by haydent » Thu May 04, 2023 3:36 pm

thanks, did find this on a guide somewhere maybe by you too :)

User avatar
Active Member

Posts

Joined
Wed Nov 09, 2011 9:50 am
Location - Sydney, Australia

Post by speakspaceAdmin » Fri Aug 25, 2023 5:29 am

Go to Design > SEO url. Find the en-gb one and delete that little sucker.


Posts

Joined
Sat Nov 26, 2022 7:24 pm

Post by haydent » Fri Aug 25, 2023 7:12 am

Oh, that is neat if it's that simple! Will try it later

User avatar
Active Member

Posts

Joined
Wed Nov 09, 2011 9:50 am
Location - Sydney, Australia

Post by haydent » Mon Aug 28, 2023 4:06 pm

speakspaceAdmin wrote:
Fri Aug 25, 2023 5:29 am
Go to Design > SEO url. Find the en-gb one and delete that little sucker.
this didnt work, it did get rid of the en-gb, but it left the un-seo query such as /product/product_name?language=en-gb

if i just clear the keyword, its closer, but you get 2 //

User avatar
Active Member

Posts

Joined
Wed Nov 09, 2011 9:50 am
Location - Sydney, Australia

Post by haydent » Mon Aug 28, 2023 6:02 pm

ok i worked out that you can fix the // bug easily , as found that it was intended to be a valid option to leave keyword blank to hide a parameter
https://github.com/opencart/opencart/pull/12651
"Leave blank if you just want to remove the perimeter."

User avatar
Active Member

Posts

Joined
Wed Nov 09, 2011 9:50 am
Location - Sydney, Australia

Post by inaizkhai » Mon Aug 28, 2023 7:19 pm

scottyboyyy wrote:
Sun Jan 08, 2023 7:35 pm
Why do the SEO urls contain en-gb folder now?

Is there an easy way to remove this? For example:

.com/en-gb?route=common/home
.com/en-gb/catalog/desktops/pc

to just:

.com/
.com/pc
The "/en-gb" in SEO URLs is likely due to language or regional settings. You can often fix this by adjusting the default language in your OpenCart settings to remove the language code from URLs. This should result in cleaner URLs like "example.com" and "example.com/pc".

Newbie

Posts

Joined
Mon Aug 28, 2023 7:10 pm

Post by haydent » Tue Aug 29, 2023 5:04 am

You missed the point, there is no clear way to remove it, that is the default language...

User avatar
Active Member

Posts

Joined
Wed Nov 09, 2011 9:50 am
Location - Sydney, Australia
Who is online

Users browsing this forum: No registered users and 12 guests