Article 50581 Apache2 re-direct help.

Apache2 re-direct help.

by
wh33t
from LinuxQuestions.org on (#50581)
Hey LQ,

Is anyone able to explain to me why the following does not work:

Code:<VirtualHost *:80>
ServerName www.domain.com
RewriteEngine on
RewriteCond %{SERVER_NAME} =domain.com
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>I am simply trying to make it so the user is always forwarded from http://www.domain.com to https://domain.com

When I say it doesn't work, what ends up happening is that Apache ignores the .conf and just serves the default /var/www/html/index.html file and doesn't rewrite the url at all.

FYI, the SSL does work.latest?d=yIl2AUoC8zA latest?i=kj6XiPnEyMs:c2pYqsUpztI:F7zBnMy latest?i=kj6XiPnEyMs:c2pYqsUpztI:V_sGLiP latest?d=qj6IDK7rITs latest?i=kj6XiPnEyMs:c2pYqsUpztI:gIN9vFwkj6XiPnEyMs
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments