T
T
The_RDC2016-01-16 09:17:22
Domain name market
The_RDC, 2016-01-16 09:17:22

How to connect a second domain to the site?

Good!
How to attach a second domain to a site on openCart?
At the domain, registered DNS of a hosting. On hosting in ISPmanager, I registered a new domain as a pseudonym.
Works! But! Main page only. If I follow the links on the site, the domain changes back to the old one.
How to be?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
B
brar, 2016-01-16
@brar

And the fact that this will lead to possible changes in the issuance of search engines, since they will perceive this as duplication of content, does not bother you? If not, then you need to look at the web server settings, in particular, what is configured in VirtualHosts and .htaccess. See ReWrite_cond. Alias ​​is the alias to redirect to the main one.

M
Max, 2016-01-23
@SuperMax899

Of course, the links lead to the main url, if you want it to work both on that domain and on that one, then in the cms settings -> multisite ( www.opencart.com/index.php?route=feature/feature&p...
You can make a substitution , when entering domen-1, switching to domen-2, it's easier.In the main directory on the hosting there is .htaccess, add the following there:

# HTTP Rule
RewriteCond %{HTTP_HOST} ^www.domen-1\.ru
RewriteRule ^(.*)$ http://domen-2/$1 [R=301,L]
RewriteCond %{HTTP_HOST} ^www.domen-2\.ru
RewriteRule ^(.*)$ http://domen-2/$1 [R=301,L]
RewriteCond %{HTTP_HOST} ^domen-1\.ru
RewriteRule ^(.*)$ http://domen-2.ru/$1 [R=301,L]

In my example, different visits from www are taken into account. or without, https addresses are especially sensitive (if there is ssl)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question