WebSphere Application Server & Liberty

WebSphere Application Server & Liberty

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.

 View Only
  • 1.  Redirect Current URL to New URL

    Posted Sun October 28, 2012 02:17 PM
    Hi Everybody,
    One of my applicaiton was migrated to new hardware and new version of IBM HTTPserver.

      App team wants , when customer visit the old URL, it's automatically re-direct to new URL. I was tried to add  below content under section 2 in http.conf file , but it doens't work. 

    #With RedirectMatch
    RedirectMatch ^/docs/(.*) https://new.url.com/appname/$1


    OLD URL is : https://old.url.com/appname

    Please suggest what am i missing on this.

    Thanks




  • 2.  Redirect Current URL to New URL

    Posted Sun October 28, 2012 08:02 PM
    Hi WAS
     
      Take in mind that I give you an example and information about redirect
     
      If you want to redirect from old.url.com/appname to new.url.com/appname/ I suggest redirect directive.

      type complet url (https://) the forum editor hide it
     
      Redirect /appname/ new.url.com/appname/

      Hope this helps.  Tel us if you need more support
     
    regards


  • 3.  Redirect Current URL to New URL

    Posted Mon October 29, 2012 02:32 AM

    Hi Gabriel,
    I tried with you option, but still loading old URL only,doesn't see any errors in logs


    Here is the content from httpd.conf file. URL starts with (https://)


    RedirectEngine on
    Redirect https://old.url.com/appname https://new.url.com/appname



    Recycled instance.



  • 4.  Redirect Current URL to New URL

    Posted Mon October 29, 2012 05:48 AM
    Hi WAS,

      I don't know redirectEngine directive.  The directive is RewriteEngine, I have tested without it, that is commenting RewriteEngine on orputting RewriteEngine off
     
      Check where are you putting

      Redirect https://old.url.com/appname  https://new.url.com/appname 


      I have test putting out of any Directory section and only putting


      Redirect /appname/  https://new.url.com/appname/


     
    regards


  • 5.  Redirect Current URL to New URL

    Posted Mon October 29, 2012 12:04 PM
    Hi Gabriel,
    Sorry, i am still not able to get this.  I removed all existing entries and then updated Redirect at below location.

    Is it right location to update Redirect ?

    #
    # Redirect allows you to tell clients about documents which used to exist in
    # your server's namespace, but do not anymore. This allows you to tell the
    # clients where to look for the relocated document.
    # Example:
    # Redirect permanent /foo www.example.com/bar

    Redirect /appname/  https://new.url.com/appname /


    #
    # Directives controlling the display of server-generated directory listings.
    #

    #
    # IndexOptions: Controls the appearance of server-generated directory
    # listings.
    #


    Thanks in Advance
    WAS


  • 6.  Redirect Current URL to New URL

    Posted Mon October 29, 2012 12:39 PM
    Hi WAS,

      Yeeesssss!!!! I put it there.

      I have test with IHS 6.1 and IHS 7, but i think that need to work between 6.1 and 8

    regards


  • 7.  Redirect Current URL to New URL

    Posted Mon October 29, 2012 01:25 PM
    Hi Gabriel,

    hmm, no luck, still getting Old SSO login page after the changes.


    THanks
    WAS


  • 8.  Redirect Current URL to New URL

    Posted Mon October 29, 2012 02:23 PM
    Hi WAS,

    This is the redirect rule I wrote for my app team with the same requirements as yours:

    RewriteCond %{REQUEST_URI} ^/appName/
    RewriteCond %{QUERY_STRING} ^(.*)$
    RewriteRule / https://new.url%{REQUEST_URI}$1 [R=301,L]

    Instead of doing a redirect match, I created a rewrite rule.  This way, any request for appName will automatically be directed to the URL you specify. 

    This works in a WAS 7/Network Deployment/Virtual Enterprise, clustered environment, but you should be able to tweak it to meet your needs.

    Hope this helps!

    Danielle


  • 9.  Redirect Current URL to New URL

    Posted Tue October 30, 2012 11:06 AM
    WAS,


      Sure that Danielle's suggestion works fine.

      Thank for shared your solution Danielle.

    Regards