E
E
Exnefus2015-01-06 07:05:53
Web servers
Exnefus, 2015-01-06 07:05:53

[web server] How to set up domain redirects from www.examle.com to examle.com?

We have installed and almost successfully use the server on Zentyal. It contains several sites. When binding new domains to the server, only domains without www (examle.com) are correctly addressed. When typing a domain from www (www.example.com), it addresses the first domain entered. In this case, if the first domain is entered from www, then it works fine.
Redirect via *.htaccess, access to the first site is lost.
Redirecting through the index page also breaks access to the first site.
Redirecting through the domain registrar also does not work.
I understand that redirection should be done through Apache?
If possible, please give a link where to smoke

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
Eugene, 2015-01-06
@Nc_Soft

Smoking should be no closer than 15 meters from bus stops.
.htaccess

RewriteEngine   on
Options +FollowSymLinks 
RewriteCond %{HTTP_HOST} ^www\.site\.ru
RewriteRule ^(.*)$ http://site.ru/$1 [R=301,L]

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question