Forum Discussion

Shohab_Baig_841's avatar
Shohab_Baig_841
Icon for Nimbostratus rankNimbostratus
Oct 05, 2007

redirect just first page (defualt page) of a website

Hi

 

 

I am trying to redirect just the first page of a domain name web site. for example if anyone hits http://test.com should be redirected to http://www.test.com but anyone access any other page on test.com e.g. http://test.com/test/test.asp should stay on same URL which is test.com and not redirect it to http://www.test.com Please help.

 

 

Thanks

 

 

Shohab

1 Reply

  • Something like this?

    
    when HTTP_REQUEST {
        redirect to www.test.com if request is to test.com and URI is /
       if {[string tolower [HTTP::Host]] eq "test.com" and [HTTP::uri] eq "/"}{
          HTTP::redirect "http://www.test.com"
       }
    }

    Aaron