Mobile app version of vmapp.org
Login or Join
Berryessa370

: Httpd not rewriting !hostname to hostname Simple: xxx.xxx.xxx.xxx:443/80 --> https://login.example.com One site, one hostname, one server. So I've done this in the main httpd.conf to avoid virtualhost

@Berryessa370

Posted in: #Apache2 #ModRewrite

Simple:

xxx.xxx.xxx.xxx:443/80 --> login.example.com

One site, one hostname, one server.

So I've done this in the main httpd.conf to avoid virtualhost manips:

<Location />
#redirects all traffic to ssl
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{HTTPS} !=on [NC]
RewriteRule ^ %{SERVER_NAME}%{REQUEST_URI} [R,L]

#redirects all not hostname to hostname
RewriteCond %{HTTP_HOST} !^login.example.com$
RewriteRule /.* login.example.com/ [R]
</Location>


SSL redirect works perfect.

Hostname redirect I can't get to work for the life of me. Tried removing trailing '', tried generic variable designations instead of static info like I have now. No dice.

Maybe I've been staring at it too long... Any insight would help tremendously.

EDIT: So it seems as though the IP is redirecting to the hostname, but not until after your prompted in the browser to accept the unsigned cert. Once you say ok it continues with the redirect. Any way around this?

10% popularity Vote Up Vote Down


Login to follow query

More posts by @Berryessa370

0 Comments

Sorted by latest first Latest Oldest Best

Back to top | Use Dark Theme