0

I have bulid two vhost with apache2.4(debian).

cat   /etc/apache2/sites-available/000-default.conf
<VirtualHost *:80>
    ServerName www.hwy.local
    ServerAdmin webmaster@localhost
    DocumentRoot /var/www/html
    ErrorLog ${APACHE_LOG_DIR}/error_hwy.log
    CustomLog ${APACHE_LOG_DIR}/access_hwy.log combined
        <Directory /var/www/html>
            Options Indexes FollowSymLinks MultiViews
            AllowOverride None
            allow from all
        </Directory>
</VirtualHost>

<VirtualHost *:80>
    ServerName www.test.app
    ServerAdmin webmaster@localhost
    DocumentRoot  /home/debian9/app
    ErrorLog ${APACHE_LOG_DIR}/error_hwy.log
    CustomLog ${APACHE_LOG_DIR}/access_hwy.log combined
        <Directory /home/debian9/app>
            Options Indexes FollowSymLinks MultiViews
            AllowOverride None
            Require all granted
        </Directory>
</VirtualHost>

Typing www.hwy.local will not redirect https://www.hwy.local,Typing www.test.app will redirect https://www.test.app,why?

  • 2
    There is nothing in either configuration to cause a redirect. They come from elsewhere. – Michael Hampton Sep 8 '18 at 14:03
  • Without the actual domains we are not able to test this, but it doesn't come from this configuration. If you have EVER configured HSTS for this domain, the address will be translated internally in the browser, without any HTTP redirect. You can't cancel that server side, because it's designed to prevent someone else from doing that. – Esa Jokinen Sep 8 '18 at 14:06
0

as per Michael Hampton says the redirection for www.test.app does not come from the apache configuration file, have there any .htaccess file in the root direcotry of the app? there could be configured a redirect!

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.