Hi Rodney, To do a 301 redirect based on a url you would use the new conditional rule syntax. I'll break that down first and then show how to use it to do a redirect. Using Conditional Rules A conditional rule basically consists of a special function type of PageBlaster token syntax that allows an IF condition to be evaluated before executing the rules that it contains. The syntax of an IF function is as follows: [PB: IF(expression1 evaloperator expression2 ) {true condition }else{false condition} ] Where: expression1: can be a literal term or the result of an inner function
Inner functions are:
Match ( expression1, expresion2 ) where expression2 can use regular expressions
Len (expresion1)
Left (expresion1,length)
Right (expresion1,length)
Substring(expresion1, start, length) evaloperator: can be any of the following operators: =, == , != , <> , >=, <=, <, >
equals, not equals, greater than or equal to, less than or equal to, less than, greater than expression2: same as expression 1 Expressions can be literal or you can use PB: tokens
The condition statements are enclosed in curly braces
The eval operator and expression are optional if you are using an inner function that evaluates to true or false.
The else part with the false condition is optional So an example conditional statement that could be used to match on a Url and do a 301 redirect would look like this: [PB: IF( Match("[PB:Request.Url]","http://snapsis.com") ) { [PB: Response.Status("301 Moved Permanently") ] [PB: Response.AddHeader("Location","http://www.snapsis.com") ] [PB: Response.End() ] } ] As you can see the special function type tokens are used to write logical code much like you would use in programming and get direct access to the request and response object. The example above does not use the else part of the IF conditional rule, but that could be added. The reason I implemented it in a declaritive way is because of the flexability it gives the end user over just having some input boxes and a list of urls that you want to redirect. As you can probably see, a lot more than simple redirects can be done with this. These special functional tokens are available to be used either in the Search For, or in the Replace With - Respond fields of the Replacement Rule interface. Another new enhancement of version 3.0 is the addition of a PageBlaster Admin interface. After installing the new module you will have a new item on bottom of the Admin Menu called PageBlaster. As an administrator this is where you would go to input Portal Rules (rules that are executed on every page request). This is probably where you would want the global 301 Redirect rules to point several alternate domains back to your main domain. There will be some extra performance hit for implementing this at the ASP.Net level instead of using an ISAPI filter that plugs into IIS but it should not be noticeable. If you use a regular expression to match your alternate Domains then you should be able to do it all in one rule. |