Options

How to respond with a 301 permanent redirect?

Posted by TODDH

Guys,

Do we have any way of responding with a 301 (permanent redirect)? I need a way to inform the search engines that my customers location is permanently moved.

Thanks,

-Todd-

Comments

  • Options
    edited February 2014
    Posted by brunov

    You can use the HTTP::respond command.

    syntax:
    HTTP::respond <status code> [content <content Value>] [<Header name> <Header Value>]+

    So you can specify headers (and set cookies) as well

    example:
    Code:





    when HTTP_REQUEST { if { not ([HTTP::host] starts_with "www") } { HTTP::respond 301 Location "http://www.abc.com/" } }




Sign In or Register to comment.