SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Member
    Join Date
    May 2012
    Posts
    21
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    .htaccess redirecting to a differnet URL and port

    Hi There,

    How can I redirect (in the backend) a certain URL to a remote target URL and port?

    For example, whenever a visitor visits intranet.mysite.com, I want this request to be redirected to an IP address and port 8080. But the important point here is, visitor shouldn't know this.

    Any suggestions?

    Thanks.

  2. #2
    Certified Ethical Hacker silver trophybronze trophy dklynn's Avatar
    Join Date
    Feb 2002
    Location
    Auckland
    Posts
    14,672
    Mentioned
    19 Post(s)
    Tagged
    3 Thread(s)
    terry,

    The REAL important point is that you're attempting to deceive visitors and browsers are designed to prohibit such nefarious activities.

    Regards,

    DK
    David K. Lynn - Data Koncepts is a long-time WebHostingBuzz (US/UK)
    Client and (unpaid) WHB Ambassador
    mod_rewrite Tutorial Article (setup, config, test & write
    mod_rewrite regex w/sample code) and Code Generator

  3. #3
    SitePoint Member
    Join Date
    May 2012
    Posts
    21
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    DK, I am not trying to "deceive" visitors. I am trying to build a "load balancer" where the load will be distributed across different EC2 and cloud servers. This is not going to be a website, instead an application.

  4. #4
    Certified Ethical Hacker silver trophybronze trophy dklynn's Avatar
    Join Date
    Feb 2002
    Location
    Auckland
    Posts
    14,672
    Mentioned
    19 Post(s)
    Tagged
    3 Thread(s)
    terry,

    In that case, there should be no problem with any redirection, would there?

    For "randomized load balancing," the Apache Foundation has this to say (using a RewriteMap). If you look under "Randomized Plain Text," you'll see that the URL changes (as it must) but to separate www1, www2, ... wwwx.

    I understand (with your explanation, thank you) but the type of redirection you described would be the kind asked about by noobie hackers, ergo, my comment. Just understand that browser creators will not allow deceptions and mod_rewrite cannot hide an absolute (external) redirection. I'm thankful that they do and applaud their foresight.

    Regards,

    DK
    David K. Lynn - Data Koncepts is a long-time WebHostingBuzz (US/UK)
    Client and (unpaid) WHB Ambassador
    mod_rewrite Tutorial Article (setup, config, test & write
    mod_rewrite regex w/sample code) and Code Generator


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •