Forum Discussion

Fasih_Ahmed_135's avatar
Fasih_Ahmed_135
Icon for Nimbostratus rankNimbostratus
Nov 08, 2013

Redirect and append URI

I'm redirecting URLs using HTTP profile, but I need to append the text value after '/'. For example, when the end user type 'www.mmicagent.com/fasih', it should redirect and append to 'www.motoristsmutual.com/map/ouragents/mmicagent/fasih'.

 

Thanks for your help.

 

Fasih Ahmed

 

2 Replies

  • Please try this:

    when HTTP_REQUEST {
        if { [string tolower [HTTP::host]] equals "www.mmicagent.com" } {
            HTTP::redirect "http://www.motoristsmutual.com/map/ouragents/mmicagent[HTTP::uri]"
        }
    }
    

    This will append whatever URI the client specifies to the end of the redirect URL.

  • Will it replace 'www.mmicagent.com' with 'www.motoristsmutual.com/map/ouragents/ mmicagent' and append '/fasih' which was originally part of the orignal URI

     

    Yes. If the request is for www.mmicagent.com, the user will be redirected to www.motoristsmutual.com. Any URI that is in the original request will get appended to the end of the redirect URI.