C
C
CapitanFreeloader2016-08-15 21:39:09
Apache HTTP Server
CapitanFreeloader, 2016-08-15 21:39:09

Why might a redirect from www to non-www not work?

There is a vesta, I didn’t change any configs after installing it, I ran into the fact that

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

or the same but only with a specific indication of domains - it doesn’t work
if you type .htaccess, then a 500 error occurs,
if you simply write RewriteEngine on, then everything opens normally
But if the rules are specified, then it does not open either via www or without www
What could be the problem ? How can I make Vesta immediately create domains without www?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Viktor Taran, 2016-08-18
@shambler81

give the whole .htaccess

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question