Redirect port / port 10000 to https apacheApache answer both HTTP and HTTPS on the same portApache2 - mod_expire and mod_rewrite not working in httpd.conf - serving content from tomcatApache redirection issue with httpsapache2 configuration for blog.example.com not workingRedirect non-www ssl traffic to www ssl (apache)Apache2 mod_proxy with gitlab on different serverRedirect apache to http requests to https except for when request is a POST?Virtual hosts with port 80 & 443 not workingapache rewrite rules, non-www, httpsI need help setting up httpd.conf file to perform redirects to same site if accessed via http and httpsHow to configure apache 2.2 to allow acme-challenge and pass all other traffic to AJP/tomcat

The origin of the Russian proverb about two hares

How do we say "within a kilometer radius spherically"?

Possible runaway argument using circuitikz

What would be the way to say "just saying" in German? (Not the literal translation)

Is Lambda Calculus purely syntactic?

Who voices the small round football sized demon In Good Omens

Can we completely replace inheritance using strategy pattern and dependency injection?

2019 gold coins to share

How can one's career as a reviewer be ended?

How to safely destroy (a large quantity of) valid checks?

What would prevent chimeras from reproducing with each other?

tabular: caption and align problem

A word that means "blending into a community too much"

What STL algorithm can determine if exactly one item in a container satisfies a predicate?

Can the removal of a duty-free sales trolley result in a measurable reduction in emissions?

Does the new finding on "reversing a quantum jump mid-flight" rule out any interpretations of QM?

UTC timestamp format for launch vehicles

What is the polarity of this barrel plug with a double circle?

Do people with slow metabolism tend to gain weight (fat) if they stop exercising?

Is using 'echo' to display attacker-controlled data on the terminal dangerous?

How to add arrows in smartdiagram (descriptive diagram)

Russian word for a male zebra

Is it okay to have a sequel start immediately after the end of the first book?

I have a problematic assistant manager, but I can't fire him



Redirect port / port 10000 to https apache


Apache answer both HTTP and HTTPS on the same portApache2 - mod_expire and mod_rewrite not working in httpd.conf - serving content from tomcatApache redirection issue with httpsapache2 configuration for blog.example.com not workingRedirect non-www ssl traffic to www ssl (apache)Apache2 mod_proxy with gitlab on different serverRedirect apache to http requests to https except for when request is a POST?Virtual hosts with port 80 & 443 not workingapache rewrite rules, non-www, httpsI need help setting up httpd.conf file to perform redirects to same site if accessed via http and httpsHow to configure apache 2.2 to allow acme-challenge and pass all other traffic to AJP/tomcat






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








0















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



















  • 2





    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

















0















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



















  • 2





    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













0












0








0








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
















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.







apache-2.2 virtualhost httpd.conf






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 12 '11 at 19:41









Mark Henderson

61.6k29164248




61.6k29164248










asked Nov 12 '11 at 14:32









HamidHamid

12018




12018







  • 2





    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












  • 2





    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







2




2





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





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





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










2 Answers
2






active

oldest

votes


















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






























    -1














    This can be archived by redirecting to a custom "400 - Bad Request" page and modify the redirection with a rewrite rule. In the following example i request




    http://test.mydomain.com:27000




    and get redirected to




    https://test.mydomain.com:27000




    with one virtual host.



    Code:



    ErrorDocument 400 /

    RewriteEngine On
    RewriteCond %HTTPS off
    RewriteRule ^/?(.*) https://%SERVER_NAME:27000/$1 [R,L]


    Or you simply redirect directly to the HTTPS version of the page.



    Code:



     ErrorDocument 400 https://test.mydomain.com:27000


    But you will loose the ability to redirect on a real "Bad Request" page.






    share|improve this answer

























      Your Answer








      StackExchange.ready(function()
      var channelOptions =
      tags: "".split(" "),
      id: "2"
      ;
      initTagRenderer("".split(" "), "".split(" "), channelOptions);

      StackExchange.using("externalEditor", function()
      // Have to fire editor after snippets, if snippets enabled
      if (StackExchange.settings.snippets.snippetsEnabled)
      StackExchange.using("snippets", function()
      createEditor();
      );

      else
      createEditor();

      );

      function createEditor()
      StackExchange.prepareEditor(
      heartbeatType: 'answer',
      autoActivateHeartbeat: false,
      convertImagesToLinks: true,
      noModals: true,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: 10,
      bindNavPrevention: true,
      postfix: "",
      imageUploader:
      brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
      contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
      allowUrls: true
      ,
      onDemand: true,
      discardSelector: ".discard-answer"
      ,immediatelyShowMarkdownHelp:true
      );



      );













      draft saved

      draft discarded


















      StackExchange.ready(
      function ()
      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f330381%2fredirect-port-port-10000-to-https-apache%23new-answer', 'question_page');

      );

      Post as a guest















      Required, but never shown

























      2 Answers
      2






      active

      oldest

      votes








      2 Answers
      2






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      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



























        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

























          1












          1








          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













          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












          share|improve this answer



          share|improve this answer










          answered Nov 12 '11 at 20:12









          Antti Rytsölä Circles ConsultAntti Rytsölä Circles Consult

          60648




          60648























              -1














              This can be archived by redirecting to a custom "400 - Bad Request" page and modify the redirection with a rewrite rule. In the following example i request




              http://test.mydomain.com:27000




              and get redirected to




              https://test.mydomain.com:27000




              with one virtual host.



              Code:



              ErrorDocument 400 /

              RewriteEngine On
              RewriteCond %HTTPS off
              RewriteRule ^/?(.*) https://%SERVER_NAME:27000/$1 [R,L]


              Or you simply redirect directly to the HTTPS version of the page.



              Code:



               ErrorDocument 400 https://test.mydomain.com:27000


              But you will loose the ability to redirect on a real "Bad Request" page.






              share|improve this answer





























                -1














                This can be archived by redirecting to a custom "400 - Bad Request" page and modify the redirection with a rewrite rule. In the following example i request




                http://test.mydomain.com:27000




                and get redirected to




                https://test.mydomain.com:27000




                with one virtual host.



                Code:



                ErrorDocument 400 /

                RewriteEngine On
                RewriteCond %HTTPS off
                RewriteRule ^/?(.*) https://%SERVER_NAME:27000/$1 [R,L]


                Or you simply redirect directly to the HTTPS version of the page.



                Code:



                 ErrorDocument 400 https://test.mydomain.com:27000


                But you will loose the ability to redirect on a real "Bad Request" page.






                share|improve this answer



























                  -1












                  -1








                  -1







                  This can be archived by redirecting to a custom "400 - Bad Request" page and modify the redirection with a rewrite rule. In the following example i request




                  http://test.mydomain.com:27000




                  and get redirected to




                  https://test.mydomain.com:27000




                  with one virtual host.



                  Code:



                  ErrorDocument 400 /

                  RewriteEngine On
                  RewriteCond %HTTPS off
                  RewriteRule ^/?(.*) https://%SERVER_NAME:27000/$1 [R,L]


                  Or you simply redirect directly to the HTTPS version of the page.



                  Code:



                   ErrorDocument 400 https://test.mydomain.com:27000


                  But you will loose the ability to redirect on a real "Bad Request" page.






                  share|improve this answer















                  This can be archived by redirecting to a custom "400 - Bad Request" page and modify the redirection with a rewrite rule. In the following example i request




                  http://test.mydomain.com:27000




                  and get redirected to




                  https://test.mydomain.com:27000




                  with one virtual host.



                  Code:



                  ErrorDocument 400 /

                  RewriteEngine On
                  RewriteCond %HTTPS off
                  RewriteRule ^/?(.*) https://%SERVER_NAME:27000/$1 [R,L]


                  Or you simply redirect directly to the HTTPS version of the page.



                  Code:



                   ErrorDocument 400 https://test.mydomain.com:27000


                  But you will loose the ability to redirect on a real "Bad Request" page.







                  share|improve this answer














                  share|improve this answer



                  share|improve this answer








                  edited Oct 11 '18 at 8:20

























                  answered Oct 10 '18 at 13:04









                  rdXrdX

                  11




                  11



























                      draft saved

                      draft discarded
















































                      Thanks for contributing an answer to Server Fault!


                      • Please be sure to answer the question. Provide details and share your research!

                      But avoid


                      • Asking for help, clarification, or responding to other answers.

                      • Making statements based on opinion; back them up with references or personal experience.

                      To learn more, see our tips on writing great answers.




                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function ()
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f330381%2fredirect-port-port-10000-to-https-apache%23new-answer', 'question_page');

                      );

                      Post as a guest















                      Required, but never shown





















































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown

































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown







                      Popular posts from this blog

                      How to write a 12-bar blues melodyI-IV-V blues progressionHow to play the bridges in a standard blues progressionHow does Gdim7 fit in C# minor?question on a certain chord progressionMusicology of Melody12 bar blues, spread rhythm: alternative to 6th chord to avoid finger stretchChord progressions/ Root key/ MelodiesHow to put chords (POP-EDM) under a given lead vocal melody (starting from a good knowledge in music theory)Are there “rules” for improvising with the minor pentatonic scale over 12-bar shuffle?Confusion about blues scale and chords

                      What if the end-user didn't have the required library?What is setup.py?What is a clean, pythonic way to have multiple constructors in Python?What does Ruby have that Python doesn't, and vice versa?What is the reason for having '//' in Python?How do I create a namespace package in Python?How to package shared objects that python modules depend on?setuptools vs. distutils: why is distutils still a thing?Navigation in Windows 10 vs code not going to virtualenv library when the same library is installed at user levelPython create package for local usePackaging a project that uses multiple python versionsWhy is permission denied on pip install except for when “--user” is included at end of command?

                      Esgonzo ibérico Índice Descrición Distribución Hábitat Ameazas Notas Véxase tamén "Acerca dos nomes dos anfibios e réptiles galegos""Chalcides bedriagai"Chalcides bedriagai en Carrascal, L. M. Salvador, A. (Eds). Enciclopedia virtual de los vertebrados españoles. Museo Nacional de Ciencias Naturales, Madrid. España.Fotos