Jump to content

Change the Main URL in a multistore envierment


Frits van Leeuwen

Recommended Posts

Hello all,

I have a multisore in Prestashop 1.7.8.10

I built my website with domain1.nl. Then I turned it into a multistore with domain2.nl. Both stores have a check mark next to Main URL.

That's how we've been doing for a long time. but domain1 hardly receives any visitors. That's why I wanted to close it again. But I do want to redirect the URL to domain2.nl .

I then went to the multistore option and moved domain1.nl to the store of domain2.

Then I removed the store from domain1.

If domain1.nl has no check mark from the main URL, everything works fine. But I want the URL domain2.nl .

But if domain2.nl has the check mark of the main URL, images are missing for subcategories and products below. Funnily enough, not the products that fall under the main category.

How can I return domain1.nl to the main URL without the problems?

Yours sincerely,

Frits van Leeuwen

Edited by Frits van Leeuwen (see edit history)
Link to comment
Share on other sites

  • Frits van Leeuwen changed the title to Change the Main URL in a multistore envierment

I have now created the store in PHPmyAdmin and linked it again in Prestashop domain1.nl. After that, domain2.nl worked as it should again.

Strangely enough, domain1.nl now links directly to domain2.nl (This is not bad, actually good). However, I have not yet succeeded in redirecting it to a subcategory.

This action would have resulted in not passing on visitors to Google Analytics.

Link to comment
Share on other sites

Hi,

Revert Domain1 to Main URL:

  • In your Prestashop BO go to "Advanced Parameters" > "Multistore."
  • Edit the configuration for domain1.nl and check the box to set it as the main URL.
  • Save your changes.

Check Subcategory and Product Images:

  • After making domain1.nl the main URL again, check if the subcategory and product images are still missing for subcategories and products below.
  • If images are missing, try clearing the Prestashop cache and your browser cache to ensure that any previous settings are not causing the issue.

If you want to redirect domain1.nl to a specific subcategory, you can do this using an .htaccess file if you're using Apache web server.

Add the following lines to redirect domain1.nl to a subcategory on domain2.nl:

RewriteEngine On
RewriteCond %{HTTP_HOST} ^domain1\.nl$ [NC]
RewriteRule ^(.*)$ http://domain2.nl/subcategory [R=301,L]

Replace domain2.nl/subcategory with the actual URL of the subcategory you want to redirect to on domain2.nl

Save the .htaccess file.

To ensure that visitors are still tracked in Google Analytics, make sure that your Google Analytics tracking code is properly set up on both domain1.nl and domain2.nl. You should have separate tracking codes for each domain/store. Verify that the tracking codes are correctly placed in the Prestashop theme templates.

After making these changes, test the redirection from domain1.nl to the subcategory on domain2.nl to ensure it works as expected.

Keep an eye on both domains to ensure that there are no further issues with images, redirection, or Google Analytics tracking.

Take backup of your website and database before making significant changes like this to ensure you can recover your site in case anything goes wrong.

 

Hope this helps!

Thanks!

Link to comment
Share on other sites

Thanks for answering.
Everything is fine now, but I actually want to get rid of the first store, because I now always have to pay attention to which store I am going to mutate something in. All stores are enabled by default. But then I can't save anything in the store. And I also don't feel like setting the rights in such a way that the data is saved from all stores, because that produces a lot of data. The products are then duplicated in the database. And I'm not looking forward to that.
I don't really dare to do this anymore, because that's where the misery started.
I deleted store1 and saw things happen at store2 that I hadn't foreseen.

Link to comment
Share on other sites

Hi,

  • If you want to get rid of the first store (domain1.nl), you can disable it in Prestashop. If you are concerned about maintaining data for historical purposes, consider exporting and archiving the data related to the old store (domain1.nl) before disabling it.
  • After disabling domain1.nl, thoroughly check domain2.nl to ensure that everything is functioning correctly. This includes product listings, images, categories, and any custom configurations. Make sure there are no unexpected issues.
  • To address the concern about duplicated products in the database, you can use the "Regenerate Shop URL" feature in Prestashop. This process should help clean up URLs and prevent duplication of products in the database.
  • Keep a close eye on your website for a while to ensure that everything continues to work as expected. Test various features, including product management, order processing, and checkout on domain2.nl.
  • Remember to update any SEO settings, such as meta tags, canonical URLs, and sitemaps, to reflect the changes made to your store URLs. This will help maintain your search engine rankings.
  • If you want to permanently redirect domain1.nl to domain2.nl, you can set up a 301 redirect in your web server's configuration or using a redirection module in Prestashop. This way, visitors to the old domain will be automatically redirected to the new one.

By following these steps carefully, you should be able to simplify your setup by removing the first store (domain1.nl) without causing significant issues with the remaining store (domain2.nl). However, if you have any doubts or concerns, it's always a good idea to consult with a Prestashop expert who can provide proper guidance for your specific setup.

Take backup of your website and database before making significant changes like this to ensure you can recover your site in case anything goes wrong.

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