Page 1 of 1

SEO Urls contain /en-gb ?

Posted: Sun Jan 08, 2023 7:35 pm
by scottyboyyy
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

Re: SEO Urls contain /en-gb ?

Posted: Sun Jan 08, 2023 8:39 pm
by JNeuhoff
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.

Re: SEO Urls contain /en-gb ?

Posted: Sun Jan 08, 2023 9:41 pm
by scottyboyyy
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.

Re: SEO Urls contain /en-gb ?

Posted: Sun Jan 08, 2023 9:58 pm
by JNeuhoff
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

Re: SEO Urls contain /en-gb ?

Posted: Thu May 04, 2023 7:10 am
by haydent
any update on this, this is terrible seo practice pushing your relavant url content deeper down the tree

Re: SEO Urls contain /en-gb ?

Posted: Thu May 04, 2023 2:05 pm
by webocreation.com
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/

Re: SEO Urls contain /en-gb ?

Posted: Thu May 04, 2023 3:36 pm
by haydent
thanks, did find this on a guide somewhere maybe by you too :)

Re: SEO Urls contain /en-gb ?

Posted: Fri Aug 25, 2023 5:29 am
by speakspaceAdmin
Go to Design > SEO url. Find the en-gb one and delete that little sucker.

Re: SEO Urls contain /en-gb ?

Posted: Fri Aug 25, 2023 7:12 am
by haydent
Oh, that is neat if it's that simple! Will try it later

Re: SEO Urls contain /en-gb ?

Posted: Mon Aug 28, 2023 4:06 pm
by haydent
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 //

Re: SEO Urls contain /en-gb ?

Posted: Mon Aug 28, 2023 6:02 pm
by haydent
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."

Re: SEO Urls contain /en-gb ?

Posted: Mon Aug 28, 2023 7:19 pm
by inaizkhai
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".

Re: SEO Urls contain /en-gb ?

Posted: Tue Aug 29, 2023 5:04 am
by haydent
You missed the point, there is no clear way to remove it, that is the default language...