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:
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 on - I did It. But leads to /html/
2. Redirect from folder /html/siteru on .
3. Below 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


<virtualhost *:80>


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

 DocumentRoot /var/www/html/siteru

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



 Redirect 301 /

 Redirect 301 /siteru

 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"

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

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


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
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>

 DocumentRoot /var/www/html/site.EN/public_html
 ErrorLog ${APACHE_LOG_DIR}/error.log
 CustomLog ${APACHE_LOG_DIR}/access.log combined


1. Redirection with on - runs.
2. The link opens /html/ where the Listing shows the folder / Although, as I understand it, the site has been opened in a folder 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 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.
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
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/ 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