ML
    • Recent
    • Categories
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    Apache Redirect IP Address

    IT Discussion
    4
    10
    1.1k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • AlyRagabA
      AlyRagab
      last edited by AlyRagab

      Dears,

      i have two Web Servers configured with Apache on AIX Power Servers , i need to make
      anyone who accesses the IP Address of the Server-1 to be redirected to the IP Address of the Server-2.
      i have added the below in the httpd.conf of Server-1 but not working with me
      RewriteRule ^(.*)$ https://the.other.ip.address$1

      JaredBuschJ 1 Reply Last reply Reply Quote 0
      • J
        Jason Banned
        last edited by

        Have you tried it without using SSL? Off the top of my head I'm not 100% postivite but I believe most browsers may prevent url redirects with https for obvious reasons.

        JaredBuschJ 1 Reply Last reply Reply Quote 0
        • JaredBuschJ
          JaredBusch @Jason
          last edited by

          @Jason said in Apache Redirect IP Address:

          Have you tried it without using SSL? Off the top of my head I'm not 100% postivite but I believe most browsers may prevent url redirects with https for obvious reasons.

          Nginx has no issues with it. It is a redirect after landing it should be fine. Nothing bad about that. The SSL path is still valid.

          J 1 Reply Last reply Reply Quote 0
          • JaredBuschJ
            JaredBusch @AlyRagab
            last edited by

            @AlyRagab said in Apache Redirect IP Address:

            Dears,

            i have two Web Servers configured with Apache on AIX Power Servers , i need to make
            anyone who accesses the IP Address of the Server-1 to be redirected to the IP Address of the Server-2.
            i have added the below in the httpd.conf of Server-1 but not working with me
            RewriteRule ^(.*)$ https://the.other.ip.address$1

            I'm not familiar with Apache redirects. But Google told me this.
            http://stackoverflow.com/questions/31141092/apache-mod-rewrite-needs-to-keep-the-path-but-change-the-domain

            You use a condition and a rule.

            RewriteCond %{HTTP_HOST} !^(www\.)?exploreworlds\.co\.uk [NC]
            RewriteRule ^(.*) http://www.exploreworlds.co.uk/%{REQUEST_URI} [R=301,L]
            

            So if your condition is matching, this would be the rule.

            RewriteRule ^ http://the.other.ip%{REQUEST_URI}
            
            thwrT AlyRagabA 2 Replies Last reply Reply Quote 2
            • J
              Jason Banned @JaredBusch
              last edited by

              @JaredBusch said in Apache Redirect IP Address:

              @Jason said in Apache Redirect IP Address:

              Have you tried it without using SSL? Off the top of my head I'm not 100% postivite but I believe most browsers may prevent url redirects with https for obvious reasons.

              Nginx has no issues with it. It is a redirect after landing it should be fine. Nothing bad about that. The SSL path is still valid.

              Very possible it might be iframes I was thinking of.

              1 Reply Last reply Reply Quote 0
              • thwrT
                thwr @JaredBusch
                last edited by

                @JaredBusch said in Apache Redirect IP Address:

                @AlyRagab said in Apache Redirect IP Address:

                Dears,

                i have two Web Servers configured with Apache on AIX Power Servers , i need to make
                anyone who accesses the IP Address of the Server-1 to be redirected to the IP Address of the Server-2.
                i have added the below in the httpd.conf of Server-1 but not working with me
                RewriteRule ^(.*)$ https://the.other.ip.address$1

                I'm not familiar with Apache redirects. But Google told me this.
                http://stackoverflow.com/questions/31141092/apache-mod-rewrite-needs-to-keep-the-path-but-change-the-domain

                You use a condition and a rule.

                RewriteCond %{HTTP_HOST} !^(www\.)?exploreworlds\.co\.uk [NC]
                RewriteRule ^(.*) http://www.exploreworlds.co.uk/%{REQUEST_URI} [R=301,L]
                

                So if your condition is matching, this would be the rule.

                RewriteRule ^ http://the.other.ip%{REQUEST_URI}
                

                And make sure your config files get hit (correct vhost etc). Check logfiles.

                1 Reply Last reply Reply Quote 0
                • AlyRagabA
                  AlyRagab @JaredBusch
                  last edited by

                  @JaredBusch tried it but not working , so can i do it using mod_proxy ?.

                  thwrT 1 Reply Last reply Reply Quote 0
                  • thwrT
                    thwr @AlyRagab
                    last edited by

                    @AlyRagab said in Apache Redirect IP Address:

                    @JaredBusch tried it but not working , so can i do it using mod_proxy ?.

                    mod_proxy is a total different thing. It's a reverse proxy, acting as a client to another webserver.

                    As for your planned HTTP 301/302: I guess millions of Apaches do this simple kind of forward today. No need for mod_proxy.

                    AlyRagabA 1 Reply Last reply Reply Quote 0
                    • AlyRagabA
                      AlyRagab @thwr
                      last edited by

                      @thwr Thanks thwr for your reply ,
                      now i need to configure IP Based Redirection not URL Naming as i dont have a DNS Settings at this moment and the above suggestion is about URL Redirection so how can we do that ?.

                      1 Reply Last reply Reply Quote 0
                      • AlyRagabA
                        AlyRagab
                        last edited by

                        it is Done now and working very good:

                        RewriteEngine On

                        RewriteRule ^/ibclient$ https://remote_ip_address:port [R,L]

                        Thanks All 🙂

                        1 Reply Last reply Reply Quote 1
                        • 1 / 1
                        • First post
                          Last post