问题
Anyone can help to have "domain.com/store1/any-product" instead of "store1.domain.com/any-product"? The second is what I have and the first is what I would like to have.
Maybe some .htaccess code added? Anything else, please?
回答1:
You should be able to achieve that by using the following rule in your .htaccess
:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^store1.example.com
RewriteRule ^(.*)$ http://example.com/store1/$1 [L,NC,QSA]
What the above does is if the condition for store1.example.com
is met, then it will rewrite the URL to example.com/store1
. This will also work for any other directories you have as a part of it. So it would become example.com/store1/about
for example.
Make sure you clear your cache before you test this.
来源:https://stackoverflow.com/questions/45816211/opencart-multistore-domain-com-aaa-instead-of-aaa-domain-com