{"id":76,"date":"2019-12-11T12:31:13","date_gmt":"2019-12-11T06:31:13","guid":{"rendered":"https:\/\/goodhost.kz\/wiki\/?p=76"},"modified":"2019-12-11T12:31:13","modified_gmt":"2019-12-11T06:31:13","slug":"%d0%bf%d0%b5%d1%80%d0%b5%d0%bd%d0%b0%d0%bf%d1%80%d0%b0%d0%b2%d0%bb%d0%b5%d0%bd%d0%b8%d0%b5-apache-%d0%b8-nginx","status":"publish","type":"post","link":"https:\/\/goodhost.kz\/wiki\/?p=76","title":{"rendered":"\u041f\u0435\u0440\u0435\u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 Apache \u0438 Nginx"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">\u041f\u0435\u0440\u0435\u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 Apache \u0438 Nginx <\/h2>\n\n\n\n<h2 class=\"wp-block-heading\"> Apache<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">  \u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043c\u043e\u0434\u0443\u043b\u044f mod_rewrite<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u0414\u043b\u044f \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043f\u0435\u0440\u0435\u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0430\u043c\u0438 Apache, \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0447\u0442\u043e\u0431\u044b \u043c\u043e\u0434\u0443\u043b\u044c mod_rewrite.so \u0431\u044b\u043b \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d \u0432 Apache. <\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">LoadModule rewrite_module \/usr\/lib\/apache2\/modules\/mod_rewrite.so\n<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u0414\u043b\u044f \u0442\u043e\u0433\u043e ,\u0447\u0442\u043e\u0431\u044b \u0434\u0438\u0440\u0435\u043a\u0442\u0438\u0432\u044b mod_rewrite \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432 \n.htaccess, \u043d\u0430\u0434\u043e \u0432 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u043c \u0444\u0430\u0439\u043b\u0435 Apache, \u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u043c \n\u0440\u0430\u0437\u0434\u0435\u043b\u0435 &#171;&lt;Directory \/\u043f\u0443\u0442\u044c\/\u0434\u043e\/\u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438&gt;&#187; \u043f\u0440\u043e\u043f\u0438\u0441\u0430\u0442\u044c:\n<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">AllowOverride all\n<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u041f\u043e\u0441\u043b\u0435 \u0432\u043d\u0435\u0441\u0435\u043d\u0438\u044f \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439 \u0432 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0439 \u0444\u0430\u0439\u043b Apache, \u0434\u043b\u044f \u0432\u0441\u0442\u0443\u043f\u043b\u0435\u043d\u0438\u044f \u0432 \u0441\u0438\u043b\u0443 \u044d\u0442\u0438\u0445 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439, \u043d\u0443\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0432\u0435\u0431 \u0441\u0435\u0440\u0432\u0435\u0440:\n<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">apachectl restart\n<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u0438\u043b\u0438 \n<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">apache2ctl restart\n<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u0412 .htaccess \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u043f\u0435\u0440\u0435\u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043d\u0443\u0436\u043d\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u0434\u0438\u0440\u0435\u043a\u0442\u0438\u0432\u0443:\n<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">RewriteEngine On\n<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"> \u041f\u0440\u0430\u0432\u0438\u043b\u0430 Redirect<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u042d\u0442\u0438 \u0434\u0438\u0440\u0435\u043a\u0442\u0438\u0432\u044b \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u0440\u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u043a\u0430\u043a \u0432 \u043a\u043e\u043d\u0444\u0438\u0433\u0435 Apache \u0434\u043b\u044f \u043d\u0443\u0436\u043d\u043e\u0433\u043e virtualhost, \u0442\u0430\u043a \u0432 \u0444\u0430\u0439\u043b\u0435 .htaccess.\n<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"> Redirect \u0438\u043b\u0438 RedirectPermanent<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u0413\u043b\u0430\u0432\u043d\u044b\u0439 \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043e\u043a \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u0440\u0430\u0432\u0438\u043b \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \n\u0430\u0434\u0440\u0435\u0441\u0430 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u0440\u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u043d\u043e\u0432\u043e\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u043e. \u0415\u0441\u043b\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \n\u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0440\u0435\u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0432, \u0442\u043e \u043a\u0430\u0436\u0434\u044b\u0439 \u043d\u043e\u0432\u044b\u0439 \u0440\u0435\u0434\u0438\u0440\u0435\u043a\u0442 \u043f\u0438\u0448\u0435\u0442\u0441\u044f \u0441 \u043d\u043e\u0432\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438.\n<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u0415\u0441\u043b\u0438 \u043d\u0443\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0440\u0435\u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0432, \u0442\u043e \u043a\u0430\u0436\u0434\u044b\u0439 \u043d\u043e\u0432\u044b\u0439 \u0440\u0435\u0434\u0438\u0440\u0435\u043a\u0442 \u043d\u0443\u0436\u043d\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0441 \u043d\u043e\u0432\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438. \n<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">Redirect 301 \/old-page.html <a href=\"http:\/\/new-domain.ru\/new-page.html\">http:\/\/new-domain.ru\/new-page.html<\/a>\n<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u0438\u043b\u0438\n<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">Redirect permanent \/old-page.html <a href=\"http:\/\/new-domain.ru\/new-page.html\">http:\/\/new-domain.ru\/new-page.html<\/a>\n<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u0414\u043b\u044f \u043f\u0435\u0440\u0435\u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0432\u0441\u0435\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u043d\u0430 \u0434\u0440\u0443\u0433\u043e\u0439 \u0441\u0430\u0439\u0442 \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044e:\n<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">Redirect 301 \/ <a href=\"http:\/\/new-domain.ru\/\">http:\/\/new-domain.ru\/<\/a>\n<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u0438\u043b\u0438\n<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">Redirect permanent \/ <a href=\"http:\/\/new-domain.ru\/\">http:\/\/new-domain.ru\/<\/a>\n<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"> RedirectMatch<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u042d\u0442\u043e\u0442 \u0440\u0435\u0434\u0438\u0440\u0435\u043a\u0442 \u043e\u0442\u043b\u0438\u0447\u0430\u0435\u0442\u0441\u044f \u0442\u0435\u043c, \u0447\u0442\u043e \u0432 \u043d\u0435\u043c \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u043e\u0435\n \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043f\u0440\u0438 \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u0435 \u0441\u0430\u0439\u0442\u0430 \u0441 Windows \u043d\u0430 Linux, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \n\u0441\u043c\u0435\u043d\u0438\u0442\u044c \u0432\u0441\u0435 \u0441\u0441\u044b\u043b\u043a\u0438 \u0441 *.php \u043d\u0430 *.aspx:\n<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">RedirectMatch \/(.*)\\.aspx$ \/$1.php\n<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"> RewriteRule<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u0414\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u043c\u043e\u0434\u0443\u043b\u044f \u0443\u0431\u0435\u0434\u0438\u0442\u0435\u0441\u044c \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u0430 \u043e\u043f\u0446\u0438\u044f <strong>FollowSymLinks<\/strong>, \u044d\u0442\u0443 \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u043d\u0443\u0436\u043d\u043e \u043f\u0440\u043e\u043f\u0438\u0441\u0430\u0442\u044c \u0432 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u043c \u0444\u0430\u0439\u043b\u0435 Apache \u0438\u043b\u0438 \u0432 \u0444\u0430\u0439\u043b\u0435 <strong>.htaccess<\/strong> \u043a\u0430\u043a \u0443\u043a\u0430\u0437\u0430\u043d\u043e \u043d\u0438\u0436\u0435.\n<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0441\u0430\u043c\u044b\u0435 \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0451\u043d\u043d\u044b\u0435 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b \u0435\u0451 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f.\n<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"> \u0420\u0435\u0434\u0438\u0440\u0435\u043a\u0442 \u0441 \u043e\u0434\u043d\u043e\u0433\u043e \u0441\u0430\u0439\u0442\u0430 \u043d\u0430 \u0434\u0440\u0443\u0433\u043e\u0439 <\/h3>\n\n\n\n<pre class=\"wp-block-preformatted\">RewriteEngine On\nRewriteCond&nbsp;%{HTTP_HOST} domain1.ua\nRewriteRule (.*) <a href=\"http:\/\/domain2.ua\/$1\">http:\/\/domain2.ua\/$1<\/a> [R=301,L]\n<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\"> \u0420\u0435\u0434\u0438\u0440\u0435\u043a\u0442 \u0441 www \u043d\u0430 \u0431\u0435\u0437 www<\/h4>\n\n\n\n<pre class=\"wp-block-preformatted\">Options +FollowSymLinks\nRewriteEngine On\nRewriteCond&nbsp;%{HTTP_HOST} ^www\\.(.*) [NC]\nRewriteRule ^(.*)$ <a href=\"http:\/\/%1\/$1\">http:\/\/%1\/$1<\/a> [R=301,L]\n<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u0418\u043b\u0438 \u0431\u043e\u043b\u0435\u0435 \u043f\u043e\u043d\u044f\u0442\u043d\u044b\u0439 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441\n<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">Options +FollowSymLinks\nRewriteEngine On\nRewriteCond&nbsp;%{HTTP_HOST} ^www.domain\\.com$ [NC]\nRewriteRule ^(.*)$ <a href=\"http:\/\/domain.com\/$1\">http:\/\/domain.com\/$1<\/a> [R=301,L]\n<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043b\u044e\u0431\u043e\u0439.\n<\/p>\n\n\n\n<h4 class=\"wp-block-heading\"> \u0420\u0435\u0434\u0438\u0440\u0435\u043a\u0442 \u0441 \u0431\u0435\u0437 www \u043d\u0430 www<\/h4>\n\n\n\n<pre class=\"wp-block-preformatted\">RewriteEngine On\nRewriteCond&nbsp;%{HTTP_HOST}&nbsp;!^www\\.(.*) [NC]\nRewriteRule ^(.*)$ <a href=\"http:\/\/www.%1\/$1\">http:\/\/www.%1\/$1<\/a> [R=301,L] \n<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u0410\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u0430:\n<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">Options +FollowSymLinks\nRewriteEngine On\nRewriteCond&nbsp;%{HTTP_HOST} ^domain\\.com$ [NC]\nRewriteRule ^(.*)$ <a href=\"http:\/\/www.domain.com\/$1\">http:\/\/www.domain.com\/$1<\/a> [R=301,L]\n<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\"> \u041f\u0435\u0440\u0435\u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0434\u043e\u043c\u0435\u043d\u0430 \u0441 https \u043d\u0430 http<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">\u0414\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0434\u0430\u043d\u043d\u043e\u0435 \u043f\u0435\u0440\u0435\u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u043b\u043e, \u0434\u043e\u043b\u0436\u0435\u043d \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e Web-\u0441\u0435\u0440\u0432\u0435\u0440 <strong>Apache<\/strong>. \u041f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u0441\u0432\u044f\u0437\u043a\u0438 <strong>Nginx<\/strong>+<strong>Apache<\/strong>  \u0431\u0443\u0434\u0435\u0442 \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0442\u044c \u043e\u0448\u0438\u0431\u043a\u0430 \u0446\u0438\u043a\u043b\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u043f\u0435\u0440\u0435\u0430\u0434\u0440\u0435\u0441\u0430\u0446\u0438\u0438. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0440\u0435\u0434\u0438\u0440\u0435\u043a\u0442 \u043d\u0443\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442  \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0442\u044c \u0438\u043c\u0435\u043d\u043d\u043e \u0432 Nginx <\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">RewriteEngine On\nRewriteCond&nbsp;%{SERVER_PORT} ^443$ [OR]\nRewriteCond&nbsp;%{HTTPS} =on\nRewriteRule ^(.*)$ <a href=\"http:\/\/www.domain.com\/$1\">http:\/\/www.domain.com\/$1<\/a> [R=301,L]\n<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\"> \u041f\u0435\u0440\u0435\u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0434\u043e\u043c\u0435\u043d\u0430 \u0441 http \u043d\u0430 https<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">\u0414\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0434\u0430\u043d\u043d\u043e\u0435 \u043f\u0435\u0440\u0435\u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u043b\u043e, \u0434\u043e\u043b\u0436\u0435\u043d \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e Web-\u0441\u0435\u0440\u0432\u0435\u0440 <strong>Apache<\/strong>. \u041f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u0441\u0432\u044f\u0437\u043a\u0438 <strong>Nginx<\/strong>+<strong>Apache<\/strong>  \u0431\u0443\u0434\u0435\u0442 \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0442\u044c \u043e\u0448\u0438\u0431\u043a\u0430 \u0446\u0438\u043a\u043b\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u043f\u0435\u0440\u0435\u0430\u0434\u0440\u0435\u0441\u0430\u0446\u0438\u0438. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0440\u0435\u0434\u0438\u0440\u0435\u043a\u0442 \u043d\u0443\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0442\u044c \u0438\u043c\u0435\u043d\u043d\u043e \u0432 Nginx <\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">RewriteEngine On\nRewriteCond&nbsp;%{SERVER_PORT} ^80$ [OR]\nRewriteCond&nbsp;%{HTTP} =on\nRewriteRule ^(.*)$ <a href=\"https:\/\/www.domain.com\/$1\">https:\/\/www.domain.com\/$1<\/a> [R=301,L]\n<\/pre>\n\n\n\n<h1 class=\"wp-block-heading\"> Nginx<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">\u041c\u043e\u0434\u0443\u043b\u044c ngx_http_rewrite_module, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0439 \u0434\u043b\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u043f\u0435\u0440\u0435\u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0439, \u043e\u043d \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0432\u043c\u0435\u0441\u0442\u0435 \u0441 Nginx.\n<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"> \u0420\u0435\u0434\u0438\u0440\u0435\u043a\u0442 301 \u0441 www.domain.com \u043d\u0430 domain.com<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u0414\u043b\u044f Nginx \u0432\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0434\u0432\u0435 \u0441\u0435\u043a\u0446\u0438\u0438 <strong>server<\/strong> \u0432 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0439 \u0444\u0430\u0439\u043b, \u043e\u0434\u043d\u0430 \u0434\u043b\u044f \u0434\u043e\u043c\u0435\u043d\u0430 \u0441 www, \u0432\u0442\u043e\u0440\u0430\u044f \u0434\u043b\u044f \u0434\u043e\u043c\u0435\u043d\u0430 \u0431\u0435\u0437 www:\n<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u0421\u0435\u043a\u0446\u0438\u044f <strong>server<\/strong> \u0434\u043b\u044f \u0440\u0435\u0434\u0438\u0440\u0435\u043a\u0442\u0430:\n<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">server {\n     listen  80;\n     server_name  www.domain.com;\n     rewrite ^ <a href=\"http:\/\/domain.com$request_uri\">http:\/\/domain.com$request_uri<\/a>? permanent; \n}\n<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u0421\u0435\u043a\u0446\u0438\u044f <strong>server<\/strong>, \u0433\u0434\u0435 \u043d\u0430\u0445\u043e\u0434\u044f\u0442\u0441\u044f \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0434\u043e\u043c\u0435\u043d\u0430:\n<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">server {\n     listen  80;\n     server_name domain.com;\n.....\n}\n<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u041f\u043e\u0441\u043b\u0435 \u0432\u043d\u0435\u0441\u0435\u043d\u0438\u044f \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439 \u0432 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0439 \u0444\u0430\u0439\u043b Nginx, \u0434\u043b\u044f \u0432\u0441\u0442\u0443\u043f\u043b\u0435\u043d\u0438\u044f \u0432 \u0441\u0438\u043b\u0443 \u044d\u0442\u0438\u0445 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439, \u043d\u0443\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0432\u0435\u0431 \u0441\u0435\u0440\u0432\u0435\u0440.\n<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">service nginx restart\n<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"> \u0420\u0435\u0434\u0438\u0440\u0435\u043a\u0442 301 \u0441 domain.com \u043d\u0430 www.domain.com <\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u0414\u043b\u044f Nginx \u0432\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0434\u0432\u0435 \u0441\u0435\u043a\u0446\u0438\u0438 server \u0432 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0439 \u0444\u0430\u0439\u043b, \u043e\u0434\u043d\u0430 \u0434\u043b\u044f \u0434\u043e\u043c\u0435\u043d\u0430 \u0431\u0435\u0437 www, \u0432\u0442\u043e\u0440\u0430\u044f \u0434\u043b\u044f \u0434\u043e\u043c\u0435\u043d\u0430 \u0441 www. \n<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u0421\u0435\u043a\u0446\u0438\u044f <strong>server<\/strong> \u0434\u043b\u044f \u0440\u0435\u0434\u0438\u0440\u0435\u043a\u0442\u0430:\n<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">server {\n     listen  80;\n     server_name  domain.com;\n     rewrite ^ <a href=\"http:\/\/www.domain.com$request_uri\">http:\/\/www.domain.com$request_uri<\/a>? permanent; \n}\n<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u0421\u0435\u043a\u0446\u0438\u044f <strong>server<\/strong>, \u0433\u0434\u0435 \u043d\u0430\u0445\u043e\u0434\u044f\u0442\u0441\u044f \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0434\u043e\u043c\u0435\u043d\u0430. \n<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">server {\n     listen  80;\n     server_name www.domain.com;\n.....\n}\n<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u041f\u043e\u0441\u043b\u0435 \u0432\u043d\u0435\u0441\u0435\u043d\u0438\u044f \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439 \u0432 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0439 \u0444\u0430\u0439\u043b Nginx, \u0434\u043b\u044f \u0432\u0441\u0442\u0443\u043f\u043b\u0435\u043d\u0438\u044f \u0432 \u0441\u0438\u043b\u0443 \u044d\u0442\u0438\u0445 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439, \u043d\u0443\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0432\u0435\u0431 \u0441\u0435\u0440\u0432\u0435\u0440.\n<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">service nginx restart\n<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"> \u0420\u0435\u0434\u0438\u0440\u0435\u043a\u0442 301 \u0441 https \u043d\u0430 http<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u0414\u043b\u044f Nginx \u0432\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0434\u0432\u0435 \u0441\u0435\u043a\u0446\u0438\u0438 <strong>server<\/strong> \u0432 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0439 \u0444\u0430\u0439\u043b, \u043e\u0434\u043d\u0430 \u0434\u043b\u044f https(443 \u043f\u043e\u0440\u0442), \u0432\u0442\u043e\u0440\u0430\u044f \u0434\u043b\u044f http(80 \u043f\u043e\u0440\u0442). \n<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u0421\u0435\u043a\u0446\u0438\u044f <strong>server<\/strong> \u0434\u043b\u044f \u043e\u0442\u043a\u0440\u044b\u0442\u0438\u044f \u043f\u043e https(443 \u043f\u043e\u0440\u0442) \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0440\u0435\u0434\u0438\u0440\u0435\u043a\u0442\u0430:\n<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">server {\n   listen  443;\n   server_name  www.domain.com;\n   rewrite ^ <a href=\"http:\/\/www.domain.com$request_uri\">http:\/\/www.domain.com$request_uri<\/a>? permanent; \n}\n<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u0421\u0435\u043a\u0446\u0438\u044f <strong>server<\/strong>, \u0434\u043b\u044f \u043e\u0442\u043a\u0440\u044b\u0442\u0438\u044f \u043f\u043e http(80 \u043f\u043e\u0440\u0442), \u0433\u0434\u0435 \u043d\u0430\u0445\u043e\u0434\u044f\u0442\u0441\u044f \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0434\u043e\u043c\u0435\u043d\u0430.\n<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">server {\n   listen  80;\n   server_name www.domain.com;\n.....\n}\n<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u041f\u043e\u0441\u043b\u0435 \u0432\u043d\u0435\u0441\u0435\u043d\u0438\u044f \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439 \u0432 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0439 \u0444\u0430\u0439\u043b Nginx, \u0434\u043b\u044f \u0432\u0441\u0442\u0443\u043f\u043b\u0435\u043d\u0438\u044f \u0432 \u0441\u0438\u043b\u0443 \u044d\u0442\u0438\u0445 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439, \u043d\u0443\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0432\u0435\u0431 \u0441\u0435\u0440\u0432\u0435\u0440.\n<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">service nginx restart\n<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"> \u0420\u0435\u0434\u0438\u0440\u0435\u043a\u0442 301 \u0441 http \u043d\u0430 https<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u0414\u043b\u044f Nginx \u0432\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0434\u0432\u0435 \u0441\u0435\u043a\u0446\u0438\u0438 <strong>server<\/strong> \u0432 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0439 \u0444\u0430\u0439\u043b, \u043e\u0434\u043d\u0430 \u0434\u043b\u044f http(80 \u043f\u043e\u0440\u0442), \u0432\u0442\u043e\u0440\u0430\u044f \u0434\u043b\u044f https(443 \u043f\u043e\u0440\u0442). \n<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong> \u0414\u043b\u044f \u043d\u043e\u0432\u043e\u0433\u043e \u0434\u043e\u043c\u0435\u043d\u0430 \u0432 \u043a\u043e\u043d\u0444. \u0444\u0430\u0439\u043b\u0435 nginx <\/strong>\n<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u0421\u0435\u043a\u0446\u0438\u044f <strong>server<\/strong>, \u0434\u043b\u044f \u043e\u0442\u043a\u0440\u044b\u0442\u0438\u044f \u043f\u043e http(80 \u043f\u043e\u0440\u0442) \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u043f\u0435\u0440\u0435\u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f:\n<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">server {\n    listen  IP.\u0441\u0435.\u0440\u0432\u0435.\u0440\u0430:80;\n    server_name  www.domain.com;\n    rewrite ^ <a href=\"https:\/\/www.domain.com$request_uri\">https:\/\/www.domain.com$request_uri<\/a>? permanent; \n}\n<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u0421\u0435\u043a\u0446\u0438\u044f <strong>server<\/strong>, \u0434\u043b\u044f \u043e\u0442\u043a\u0440\u044b\u0442\u0438\u044f \u043f\u043e https(443 \u043f\u043e\u0440\u0442), \u0433\u0434\u0435 \u043d\u0430\u0445\u043e\u0434\u044f\u0442\u0441\u044f \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0434\u043e\u043c\u0435\u043d\u0430.\n<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">server {\n    listen  IP.\u0441\u0435.\u0440\u0432\u0435.\u0440\u0430:443;\n    server_name www.domain.com;\n.....\n}\n<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><strong> \u0414\u043b\u044f \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0433\u043e \u0434\u043e\u043c\u0435\u043d\u0430 \u0432 \u043a\u043e\u043d\u0444. \u0444\u0430\u0439\u043b\u0435 nginx <\/strong>\n<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u0415\u0441\u043b\u0438 \u0432\u044b \u0432\u043d\u043e\u0441\u0438\u0442\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0432 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0443\u044e \u0441\u0435\u043a\u0446\u0438\u044e \u043a\u043e\u043d\u0444. \u0444\u0430\u0439\u043b\u0430 nginx \u0434\u0435\u043b\u0430\u0439\u0442\u0435 \u044d\u0442\u043e \u0442\u0430\u043a:\n\u0418\u0437 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0441\u0435\u043a\u0446\u0438\u0438 \u0434\u043e\u043c\u0435\u043d\u0430 \u0443\u0434\u0430\u043b\u0438\u0442\u0435 \u0441\u0442\u0440\u043e\u043a\u0443 \u0432\u0438\u0434\u0430\n<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">     listen  IP.\u0441\u0435.\u0440\u0432\u0435.\u0440\u0430:80;\n<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u0418 \u0441\u043e\u0437\u0434\u0430\u0439\u0442\u0435 \u043d\u043e\u0432\u0443\u044e \u0441\u0435\u043a\u0446\u0438\u044e server \u0442\u0430\u043a\u043e\u0433\u043e \u0432\u0438\u0434\u0430:\n<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">server {\n    listen  IP.\u0441\u0435.\u0440\u0432\u0435.\u0440\u0430:80;\n    server_name  www.domain.com;\n    rewrite ^ <a href=\"https:\/\/www.domain.com$request_uri\">https:\/\/www.domain.com$request_uri<\/a>? permanent; \n}\n<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u041f\u043e\u0441\u043b\u0435 \u0432\u043d\u0435\u0441\u0435\u043d\u0438\u044f \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439 \u0432 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0439 \u0444\u0430\u0439\u043b Nginx, \u0434\u043b\u044f \u0432\u0441\u0442\u0443\u043f\u043b\u0435\u043d\u0438\u044f \u0432 \u0441\u0438\u043b\u0443 \u044d\u0442\u0438\u0445 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439, \u043d\u0443\u0436\u043d\u043e \u0435\u0433\u043e \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0442\u0430\u043a:\n<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">service nginx restart\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u041f\u0435\u0440\u0435\u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 Apache \u0438 Nginx Apache \u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043c\u043e\u0434\u0443\u043b\u044f mod_rewrite \u0414\u043b\u044f \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043f\u0435\u0440\u0435\u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0430\u043c\u0438 Apache, \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0447\u0442\u043e\u0431\u044b \u043c\u043e\u0434\u0443\u043b\u044c mod_rewrite.so \u0431\u044b\u043b \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d \u0432 Apache. LoadModule rewrite_module \/usr\/lib\/apache2\/modules\/mod_rewrite.so \u0414\u043b\u044f \u0442\u043e\u0433\u043e ,\u0447\u0442\u043e\u0431\u044b \u0434\u0438\u0440\u0435\u043a\u0442\u0438\u0432\u044b mod_rewrite \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432 .htaccess, \u043d\u0430\u0434\u043e \u0432 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u043c \u0444\u0430\u0439\u043b\u0435 Apache, \u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u043c \u0440\u0430\u0437\u0434\u0435\u043b\u0435 &#171;&lt;Directory \/\u043f\u0443\u0442\u044c\/\u0434\u043e\/\u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438&gt;&#187; \u043f\u0440\u043e\u043f\u0438\u0441\u0430\u0442\u044c: AllowOverride all \u041f\u043e\u0441\u043b\u0435 \u0432\u043d\u0435\u0441\u0435\u043d\u0438\u044f \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439 \u0432 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0439 \u0444\u0430\u0439\u043b Apache, \u0434\u043b\u044f ..<\/p>\n<div class=\"clear-fix\"><\/div>\n<p><a href=\"https:\/\/goodhost.kz\/wiki\/?p=76\" title=\"\u0447\u0438\u0442\u0430\u0442\u044c...\">\u0427\u0438\u0442\u0430\u0442\u044c \u0434\u0430\u043b\u0435\u0435<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[],"class_list":["post-76","post","type-post","status-publish","format-standard","hentry","category---vds-vps"],"_links":{"self":[{"href":"https:\/\/goodhost.kz\/wiki\/index.php?rest_route=\/wp\/v2\/posts\/76","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/goodhost.kz\/wiki\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/goodhost.kz\/wiki\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/goodhost.kz\/wiki\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/goodhost.kz\/wiki\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=76"}],"version-history":[{"count":1,"href":"https:\/\/goodhost.kz\/wiki\/index.php?rest_route=\/wp\/v2\/posts\/76\/revisions"}],"predecessor-version":[{"id":77,"href":"https:\/\/goodhost.kz\/wiki\/index.php?rest_route=\/wp\/v2\/posts\/76\/revisions\/77"}],"wp:attachment":[{"href":"https:\/\/goodhost.kz\/wiki\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=76"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/goodhost.kz\/wiki\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=76"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/goodhost.kz\/wiki\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=76"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}