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/



I solved the problem.


<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



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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.