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:
- Set up the base URL in Magento for each website.
- Cpanel -> Direct Admin -> Setting the domain pointers for each website (but it does not supports /no).
- 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 ?
1 Answer 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"
Explore related questions
See similar questions with these tags.