0

Everytime I try to access to http://server-ip/folder1 it redirects me to http://example.com

I want to access to folder1 but it´s impossible because it's redirected to http://example.com/folder1

Here is my virtual host configuration in /etc/apache2/sites-enabled/000-default-ssl.conf

<VirtualHost *:80>

ServerAdmin webmaster@localhost
ServerName example.com
DocumentRoot /var/www/html/exampleSite/
RewriteEngine On
RewriteCond %{REQUEST_URI} !^/folder1/
RewriteCond %{REQUEST_URI} !^/folder2/
</VirtualHost>

Thanks!

1 Answer 1

0

I solved the problem.

Solution:

<VirtualHost *:80>

ServerAdmin webmaster@localhost
ServerName ip-of-server
DocumentRoot /var/www/html/

<Directory /var/www/html/emall2>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted

</Directory>
</VirtualHost>

Greetings!

2
  • You created an entirely new vHost container (with a different document root)?
    – MrWhite
    Commented Nov 9, 2019 at 10:59
  • yes, I created a separated vhost container for port 80, and the document root is the IP of the server. Commented Nov 11, 2019 at 21:05

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .