0

We have single codebase and 2 Multi-websites

domain.de domain.uk

Now we want to create a new one domain.com/no so we want to set the baseurl domain.com/no instead of domain.com/

Currently, We followed three steps to make these sites live:

  1. Set up the base URL in Magento for each website.
  2. Cpanel -> Direct Admin -> Setting the domain pointers for each website (but it does not supports /no).
  3. Added necessary entries to the pub/.htaccess file. For example

(.htaccess) Set environment variables for multi-site setup

RewriteCond %{HTTP_HOST} ^(www\.)?domain\.de$
RewriteRule .* - [E=MAGE_RUN_CODE:de,E=MAGE_RUN_TYPE:website]
RewriteCond %{HTTP_HOST} ^(www\.)?domain\.uk$
RewriteRule .* - [E=MAGE_RUN_CODE:uk,E=MAGE_RUN_TYPE:website]

We have setup the base-url and media and static links to

https://domain.com/no/
https://domain.com/no/static/
https://domain.com/no/media/

Domain pointers pointing to domain.com Created the index.php & .htaccess domain.com/no is accessible but links and images are 404 as they still accessible on domain.com when removing the no/ from the path

Q:- Is there something I'm missing ?

Q:- Is there any way to achieve it without creating the sub directory /no ?

Kareem k
4403 silver badges10 bronze badges
asked Feb 6 at 6:52

1 Answer 1

1

No need to create the separate directory, just create a custom router and play with it!

set base_url domain.com/no and media & static to domain.com/static & domain.com/media

Now the logic is Create a custom router and set path to "wihtout no"

answered Feb 25 at 11:22

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.