0

I want to have many sites with the same domain, for example, example.com/site1, example.com/site2, and so on...

This is what I've done by far:

1- Change base URL of the site for example.com/site1

2- Create a folder inside root/site1 and add index.php file on site1 folder.

3- Modify the index.php folder with the website code.

4- Create in Pub/site1 folder and again add index.php

I can access the page example.com/site1, but it has no styles or design, also if I click to any of the links it redirects me to example.com and throws 404 error.

Thanks!

0

You can go to Stores -> Configuration -> General -> Web -> Add Store Code to Urls (select Yes). Delete cache and you will see your second store by code of store view

0

I found the solution.

In Stores>Configuration>(choose site, not default config)>web

I typed this

in Base URL for Static View Files: example.com/pub/static

in Base URL for User Media Files: example.com/pub/media

In addition I followed this answer:

https://community.magento.com/t5/Magento-2-x-Admin-Configuration/Magento-2-Multi-website-single-domain-configuration/td-p/94275

Greetings!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.