I have been reading around and trying different configurations to get a request to my server on port 10000 to redirect a http to a https request.

For some reason I can't figure out how to make it happen when i use port 10000 although i can set a rewrite rule for port 80 (implicit) to do it:

All I want is a request as follows:

http://example.com:10000

to redirect me to

https://example.com:10000

My current, vhost, the last of many different attempts is currently set as follows, but it doesn't seem to work at all:

<VirtualHost *:10000>
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_POST}%{REQUEST_URI}

ErrorLog "/var/log/httpd/webmin-redirect_error_log.log"
CustomLog "/var/log/httpd/webmin-redirect_access_log.log" common
</VirtualHost>

I'v also tried a few other things but nothing seems to work, any help would be appreciated.

EDIT: I already have a re-write in my httpd.conf that redirects port 80 to https. If I access port 10000 externally it is redirected to https, but from the lan "http://192.168.0.2:10000" it doesnt.

link|improve this question

50% accept rate
1  
Are you trying to redirect requests to Webmin? If I remember correctly, webmin has it's own web server and doesn't use Apache. So inside the LAN, you might be hitting webmin's server and the request never gets to Apache. – Marie Fischer Nov 12 '11 at 15:32
Indeed I am trying to do it with webmin, that would make sense, I'll poke around, thanks. – Hamid Elaosta Nov 12 '11 at 15:34
feedback

1 Answer

You have to decide whether port 10000 is HTTP or HTTPS. For HTTPS you will have to create a virtualhost of it's own with SSL* configuration lines. You cannot have both in the same IP in the same port.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

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