Page 1 of 1

Multidomain .htaccess problem

Posted: Sat Dec 02, 2017 6:09 pm
by eronny66
Hello,
I use opencart 2.1.0.2
I have a webshop with ssl and an dutch extension ********.nl.

I have added a second store with an eu extension ********.eu.
It is intended that the .eu shop points to the .nl shop, but both should use there own urlname in the adress bar.
Both have non-www url's and i have a multidomain ssl certificate.

I have changed the dns, ********.eu has a pointers to the ip of ********.nl.
and i have created a alias for ********.eu on the ********.nl. domain.

This is my .htaccess:

<FilesMatch "\.(tpl|ini|log)">
Order deny,allow
Deny from all
</FilesMatch>

# SEO URL Settings
RewriteEngine On
RewriteCond %{HTTP_HOST} ^www\.********\.nl [NC]
RewriteRule ^(.*)$ https://********.nl/$1 [L,R=301,NC]
RewriteCond %{HTTP_HOST} ^www\.********\.eu [NC]
RewriteRule ^(.*)$ https://********.eu/$1 [L,R=301]

Unfortunately, just the ********.nl is visable in the address bar. (with ssl)
If i trie the ********.eu it still displays ********.nl

Can someone help me with the right .htaccess ?

Many thanks in advance

Best regards Ronny

Re: Multidomain .htaccess problem

Posted: Sat Dec 02, 2017 6:53 pm
by CoronaTechniek
Try this for your www and ssl

Code: Select all

#Force www: not sub
RewriteCond %{HTTP_HOST} ^[0-9a-zA-Z-]+\.[a-zA-Z]{2,}$
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]
#Force www: not sub

#SSL
RewriteCond %{HTTPS} !=on
RewriteCond %{HTTP:X-Forwarded-Proto} !https [NC]
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
#SSL
in place of

Code: Select all

# SEO URL Settings
RewriteEngine On
RewriteCond %{HTTP_HOST} ^www\.********\.nl [NC]
RewriteRule ^(.*)$ https://********.nl/$1 [L,R=301,NC]
RewriteCond %{HTTP_HOST} ^www\.********\.eu [NC]
RewriteRule ^(.*)$ https://********.eu/$1 [L,R=301]

Re: Multidomain .htaccess problem

Posted: Wed Dec 27, 2017 8:50 pm
by eronny66
Just forgot :(

Thanx for your help !