1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

URL Redirection breaking the application

Discussion in 'Apache' started by kumarprd007, Apr 13, 2018.

  1. #1
    I have a http configuration like this, where I have added a prefix pod1 while accessing app1. Without the prefix pod1, app1 uRl is working perfectly.

    But with the prefix pod1, I am able to access app1 url, able to login, but its breaking the response(removing the prefix pod1) coming from webserver and breaking the application URL(like logout not working and other response).

    <Location /pod1/app1>
    SetHandler weblogic-handler
    WebLogicHost appserver1
    WeblogicPort 7001
    ProxyPass http://appserver1:7001/app1
    ProxyPassReverse http://appserver1:7001/app1
    </Location>
    Code (markup):
    So if user wants to access
    http://appserver1:7001/app1
    Code (markup):
    he should use
    http://appserver1:7001/pod1/app1
    Code (markup):
    in browser.

    Am I missing something here ?

    Do I need to add a rewrite rule here ? Any help will be appreciated.
     
    Last edited: Apr 13, 2018
    kumarprd007, Apr 13, 2018 IP
  2. kumarprd007

    kumarprd007 Peon

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    1
    #2
    Without using Location directive, I used the reverse proxy directly which resolved the issue.
    SetHandler weblogic-handler
    WebLogicHost appserver1
    WeblogicPort 7001
    ProxyPass /pod1/app1 http://appserver1:7001/app1
    ProxyPassReverse /pod1/app1 http://appserver1:7001/app1
    Code (markup):
     
    kumarprd007, Apr 13, 2018 IP
  3. hostechsupport

    hostechsupport Well-Known Member

    Messages:
    413
    Likes Received:
    23
    Best Answers:
    7
    Trophy Points:
    138
    #3
    >> 1. Remove all the 301 redirects from your .htaccess / mod_rewrite config. This might also stop causing the damage in the beginning
    2. The legacy file (perhaps append something standard), like content-123-orig.html can be renamed
    3. Create new mod_rewrite rule to 302 redirects from the primary legacy URL to the new URL that will redirect all the existing links from the legacy site to the old URL for all the browsers without the cached 301 redirects.
    4. Then create mod_rewrite rules that do 302 redirects from the 301 redirect targets, which will redirect clients that were using the new website & serve the correct page for clients with a cached 301 redirect – for instance, browser A cached the 301 redirect, and so when you type in /content-123.html in its address bar, it instead tries to load “/products/widgets.html”. Because of the new 302 rule, it will report that “/products/widgets.html” has been moved temporarily to “/content-123-orig.html” and the user will load the legacy page contents.
     
    hostechsupport, Apr 13, 2018 IP