Публикации с тегом "Nginx"

???????? ?? ????? ? www

???? ??? ???? ???????? ?? ?????? site.ru ? www.site.ru, ?? ??? ?? ????? ????????? ? ????? ?????? ????????? ???????????. ????????????, ????? ?? ??????? ???????? ???????? ??? ?????? ????? ? ????????? ?? ???? ??????????????? ? ???????????. ???? ???????? ????? ? www, ?? ????????? ???????? ????? ????????? ???????. ??? Apache (????????????? ? .htaccess ??? ?????? ???????????? ?????):

RewriteEngine On

RewriteCond %{HTTP_HOST} ^site.ru$
RewriteRule (.*) http://www.site.ru/ [R=301,L]

??? Nginx:

server {
    listen          ip:port;
    server_name     site.ru;
    rewrite         ^ http://www.site.ru$request_uri? permanent;
}