Redirect from www to mysite.conf. How to make a website and a redirect from the folder to the site?

Good night.
I have a site folder:
/www/html/siteru
I can not understand how to configure mysite.conf file in /apache2/sites-enabled/
Now my settings in mysite.working conf for /www/html/
What do I need?
1. Redirection with www.site.ru on site.ru - I did It. But leads to /html/
2. Redirect from folder /html/siteru on site.ru .
3. Below site.ru worked /html/siteru/, not like now in /html/
4. To do all this without .htaccess
My config /apache2/sites-enabled/mysite.conf :

<directory var www html>

 Options-ExecCGI -Includes -Indexes

 php_admin_value open_basedir "/var/www/html/"

 php_admin_flag engine on

</directory>

<virtualhost *:80>

 ServerName site.ru

 CustomLog /var/log/apache2/site.access.log combined

 DocumentRoot /var/www/html/siteru

 ErrorLog /var/log/apache2/site.EN.error.log

 ServerAdmin webmaster@site.ru

 ServerAlias www.site.ru

 Redirect 301 / http://site.ru

 Redirect 301 /siteru http://site.ru

 AddType application/x-httpd-php .php .php3 .php4 .php5 .phtml

 AddType application/x-httpd-php-source .phps

 php_admin_value open_basedir "/var/www/html/siteru"

 php_admin_value sendmail_path "/usr/sbin/sendmail -t-i-f webmaster@site.ru"

 php_admin_value upload_tmp_dir "/var/www/html/siteru/tmp"

 php_admin_value session.save_path "/var/www/html/siteru/tmp"

</virtualhost>

Tell me what I do wrong and how to fix it?
July 12th 19 at 17:08
1 answer
July 12th 19 at 17:10
Solution
You don't need redirects, see here
Thank You. In the evening I will disassemble. - Alexandrea commented on July 12th 19 at 17:13
welcome - arne.Koepp commented on July 12th 19 at 17:16
: Look, created by Your link
<virtualhost *:80>

 ServerAdmin admin@site.ru
 ServerName site.ru
 ServerAlias www.site.ru
 DocumentRoot /var/www/html/site.EN/public_html
 ErrorLog ${APACHE_LOG_DIR}/error.log
 CustomLog ${APACHE_LOG_DIR}/access.log combined

</virtualhost>

1. Redirection with www.site.ru on site.ru - runs.
2. The link site.ru opens /html/ where the Listing shows the folder /site.ru/. Although, as I understand it, the site has been opened in a folder site.ru. In the folder is index.html
It is written for the user and loyalty to the site.EN.conf is only setting the virtual host, i.e. the code which I gave.
Can I somehow specific works DocumentRoot? Because this command specifies which folder open if you go to site.ru. I would like to understand. Or I do I screw with my апачем2 something. - Alexandrea commented on July 12th 19 at 17:19
and did service apache2 restart ?
what system do you have ? - arne.Koepp commented on July 12th 19 at 17:22
: Yes, I did.
a2ensite site.EN.conf
service apache2 restart
Everything went smoothly, no errors.
System:
No LSB modules are available.
Distributor ID: Debian
Description: Debian GNU/Linux 8.4 (jessie)
Release: 8.4
Codename: jessie - Alexandrea commented on July 12th 19 at 17:25
Again, good night.
The issue is resolved.
I have in the folder /apache2/sites-enabled/ there was two files: 000-default.conf and site.EN.conf
The default host is somehow accepted domain www.site.ru
And decided it for him.
When you request a website Apache in turn goes through the configs of the hosts in alphabetical order, until you understand what the host corresponds to a domain. And chose 000-default.conf.
Remove 000-default.conf file in /apache2/sites-enabled/ solved the problem with folders website.
Now the site is in /www/html/site.ru/public_html/ as I wanted.
I thought a2ensite site.EN.conf specify which config for the site to use.
It turned out that this is only enabling configs.
In sites-available are themselves configs in sites-enabled labels on them.
Deleted the shortcut count turned off. This is a quick way.
You can not delete the 000-default.conf and turn off the command a2dissite 000-default.conf
Thank you all:) the Issue is closed:) - Alexandrea commented on July 12th 19 at 17:28

Find more questions by tags Processing URL