The website fulfilled the redirect too many times, why?

I'm very new, still did not really understand.
My arms got a dedicated vps server, there are already a few sites, but for myself want to host a website to a real example to understand what's going on, try this website all sorts of usefulness.

On apache server, in the folders sites-available and sites-enabled ordered as written here https://hmil.ru/917/,
began to get an error about infinite redirects (before that was some other error).

The website was flooded with htaccess not understand how to configure, tried different, the result is 0.

Please help. Explain how do to the original setup of the site, how to place it that it is always necessary to specify which files as
March 23rd 20 at 18:40
1 answer
March 23rd 20 at 18:42
You set up redirect rules so he always does a redirect, remove them
In htaccess is written:

Options-Indexes

Options +FollowSymLinks

DirectoryIndex index.php

AddDefaultCharset utf-8

RewriteEngine on

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

Don't understand what do you need to write in htaccess mandatory - Ilene_Koepp5 commented on March 23rd 20 at 18:45
@Ilene_Koepp5, and why is there something to write? - arvel.Murray commented on March 23rd 20 at 18:48
@arvel.Murray, okay, I tried to leave it blank. The result is the same - an endless redirect - Ilene_Koepp5 commented on March 23rd 20 at 18:51
@Ilene_Koepp5, well, somewhere in your code you have means worth forwarding - arvel.Murray commented on March 23rd 20 at 18:54
@arvel.Murray, there is a file in the folder sites-available > site.EN.conf it is:

ServerName site.ru
ServerAlias *.site.ru

RewriteEngine on
RewriteRule (.*) http://site.ru%{REQUEST_URI} [QSA,L]

ServerAdmin test@mail.ru
DocumentRoot /var/www/site.EN

ServerName site.ru

ErrorLog /var/log/apache2/site.ru-error.log
CustomLog /var/log/apache2/site.EN.log common


AllowOverride All
Order Allow,Deny
Allow from all
#Require all granted

RewriteEngine on
RewriteCond %{SERVER_NAME} =site.ru
RewriteRule ^ http://%{SERVER_NAME}%{REQUEST_URI} [L,NE,R=permanent]

Anything more and never did. Only htaccess and site.EN.conf - Ilene_Koepp5 commented on March 23rd 20 at 18:57
@Ilene_Koepp5, so there you have the eternal redirect is written, what is there to wonder - arvel.Murray commented on March 23rd 20 at 19:00
@arvel.Murray, left both empty file, now Error 500 - server error - Ilene_Koepp5 commented on March 23rd 20 at 19:03
@Ilene_Koepp5, it was necessary to remove the eternal redirect - arvel.Murray commented on March 23rd 20 at 19:06

Find more questions by tags Apache