Forum Discussion
nitass
Mar 13, 2013Employee
your message is mixed up.
is this what you are doing?
http://subdomain.domain.com/1050/38745/productdata-reviews/category.htm
Redirect to http://www.domain.com/productdata/
http://subdomain.domain.com/1050/38745/productdata-moredata-reviews/categories.htm
Redirect to http://www.domain.com/productdata-moredata/
if so, this is an example.
[root@ve10:Active] config b rule myrule list
rule myrule {
when HTTP_REQUEST {
if { [HTTP::host] equals "subdomain.domain.com" and [HTTP::uri] ends_with "category.htm" } {
if { [scan [HTTP::path] {/%*d/%*d/%[^-]-%*s} str] == 1 } {
HTTP::respond 301 noserver Location "http://www.domain.com/${str}/"
}
} elseif { [HTTP::host] equals "subdomain.domain.com" and [HTTP::uri] ends_with "categories.htm" } {
if { [scan [HTTP::path] {/%*d/%*d/%[^-]-%[^-]-%*s} str1 str2] == 2 } {
HTTP::respond 301 noserver Location "http://www.domain.com/${str1}-${str2}/"
}
}
}
}
[root@ve10:Active] config curl -I http://subdomain.domain.com/1050/38745/productdata-reviews/category.htm
HTTP/1.0 301 Moved Permanently
Location: http://www.domain.com/productdata/
Connection: Keep-Alive
Content-Length: 0
[root@ve10:Active] config curl -I http://subdomain.domain.com/1050/38745/productdata-moredata-reviews/categories.htm
HTTP/1.0 301 Moved Permanently
Location: http://www.domain.com/productdata-moredata/
Connection: Keep-Alive
Content-Length: 0