Jump to content

site down on migration due to multiple url redirections


Recommended Posts

Hello tribe,

We made migration of our store and on the way we lost "domain.com/en", turning into a 404 error. We created the rule:

Redirect 301 /en https://www.domain.com

but later on we found out that this redirection affects any url which includes ".com/en", so basically the whole store started to create errors due to multiple redirections. As you can see so far I am far from coding, so I wanted to asked you if the recommendation openai is giving us is right. It states that to redirect "domain.com/en" to "domain.com" in a way where no other web urls are affected the code to type down at htaccess would be:

RewriteEngine On
RewriteRule ^en$ / [R=301,L]

Thanks for sharing your knowledge.

John

Link to comment
Share on other sites

6 minutes ago, musicmaster said:

Please stop using AI for this kind of problem. Searching this forum and the Prestashop Github is much more productive.

Prestashop is programmed so that when you have more than one language prefixes like /en/ will be used.

Correct, I have two languages set up in the store, but previous presta version redirected domain.com to domain.com/en, while after the upgrade only domain.com is working and domain.com/en displays a 404. I created a rule in htaccess that screwed the web because all url with /en sufix ( basically the whole web ) was being wrongly redirected. I am trying to figure out if the coding

RewriteCond %{REQUEST_URI} ^/en/?$
RewriteRule ^.*$ / [R=301,L]

will turn domain.com/en live again without affecting the rest or store url...

Link to comment
Share on other sites

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...