I set up apache to serve virtual hosts for ports 80, and 443 (see below). The problem is with "myurl2.me".

For some reason, I can access "myurl2.me/test.html" but I cannot access "myurl2.me/subdir/test.html". When I attempt to access said subdirectory, the request is picked up by the redirect virtual host, which of course sends me to the ssl version of "myurl.com" on port 443.

Does anyone have any ideas as to why this is happening? Any help would be hugely appreciated.

NameVirtualHost 12.34.56.78:80

<VirtualHost 12.34.56.78:80>
    ServerName myurl.com
    RedirectPermanent / https://myurl.com/
</VirtualHost>

<VirtualHost 12.34.56.78:80>
    ServerName myurl2.me
    DocumentRoot /var/www/myurl2.me/html
</VirtualHost>


NameVirtualHost 12.34.56.78:443

<VirtualHost 12.34.56.78:443>
     SSLEngine On
     SSLCertificateFile /etc/httpd/ssl/mycert.crt
     SSLCertificateKeyFile /etc/httpd/ssl/mykey.key
     SSLCertificateChainFile /etc/httpd/ssl/PositiveSSL.ca-bundle

     ServerName myurl.com
     DocumentRoot /var/www/myurl.com/html
</VirtualHost>
link|improve this question
feedback

migrated from stackoverflow.com Feb 1 at 3:38

This question came from our site for professional and enthusiast programmers.

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
or
required, but never shown