Jump to content

How to change "/en/" placement on url


hastalavi2

Recommended Posts

Hey there.

I have a root directory root.com, which uses a completely different homepage. And I installed this shop under the root.com/shop folder. But my website is a multilanguage one. So, my pages are like:

root.com/en/products

root.com/tr/products

But when I visit the shop page it turns into root.com/shop/en. I want to change this into -> root.com/en/shop or root.com/tr/shop.

I went through classes folder and found Link.php and Tools.php has affects on this links. For example, by using Link.php on this line:

return $this->getBaseLink($idShop, $ssl, $relativeProtocol) . $this->getLangLink($idLang, null, $idShop) . ltrim($uriPath, '/');

When I replace this with the code below:

return str_replace("/shop", "", $this->getBaseLink($idShop, $ssl, $relativeProtocol)) . $this->getLangLink($idLang, null, $idShop) . "shop/ . ltrim($uriPath, '/');

The url changes the way I desire. But this time I get the "Load cannot follow more than 20 redirections" error on the browser.

Because, normally, my website redirects all pages which starts with "en/" to their subfolders. And on the other hand, Presta tries to redirect it back.

Anyone knows a workaround this problem?

Edited by hastalavi2 (see edit history)
Link to comment
Share on other sites

  • hastalavi2 changed the title to How to change "/en/" placement on url

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...