Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.

share|improve this question
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 Nov 12 '11 at 15:34

1 Answer 1

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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