D
D
Dmitry2017-02-20 12:25:11
Apache HTTP Server
Dmitry, 2017-02-20 12:25:11

How to remove www from all domains?

Hello!
Several domains look into the directory, how to redirect all domains from www not without www using htaccess?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Di ExTreMe, 2017-02-20
@ExTreMeUA

get out of .htaccess only from the site where you implemented such a redirect

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

From all sites you need to look towards the Apache config files
<VirtualHost *:80>
    ServerAlias example.com
    RedirectMatch permanent ^/(.*) http://www.example.com/$1
</VirtualHost>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question