Quick Nav:  Online Store   |   Login | Register

301 Redirect feature for PageBlaster?

Rate this topic:

Please Register to post a reply. Another benefit of registration is the ability to subscribe to and recieve notifications of new posts.
AuthorMessages
Laurence Neville
<100 Posts
Posts:53


12/14/2007 7:36 AM  

Hi John,

A while ago you mentioned you were planning to add the ability for PageBlaster  to do 301 redirects (e.g here: 301 Redirect for multiple host names) . Is that still in the pipeline? If so is it very far from the end of the pipe?

John Mitchell
Posts:2779


12/16/2007 9:56 PM  
Sorry I missed this post earlier. It's ironic, but I was just working on 301 redirects in PageBlaster and I remembered discussing them on my site so I went a Googled to make sure I covered everything, and guess what thread came up?

Anyway, to make a long story short, I should have a new PageBlaster out within a week and it will have the ability to do 301 Redirects.
Laurence Neville
<100 Posts
Posts:53


12/17/2007 7:08 AM  

Thank you Santa, that is great news! ;)

Rodney
<100 Posts
Posts:64


01/24/2008 6:07 PM  

Posted By John Mitchell on 12/16/2007 9:56 PM
 I should have a new PageBlaster out within a week and it will have the ability to do 301 Redirects.

 

Hey John,

I have a couple of domains (homepokerhelp.com, pokerdiy.co.uk etc.) that I all want to redirect to PokerDIY.com (primary domain). I've been following Tom Kraak's blog and there seems to be a number of routes to take to implement this. I would prefer a DNN solution (as opposed to configuring IIS) so that it is self-contained. Tom recommends the UrlRewritingNet.UrlRewrite component to achieve this, but as a PageBlaster customer I would rather use your software if possible.

So, have you managed to implement 301 Redirects in PB, and will it handle my scenario?

Thanks

Rodney

 

John Mitchell
Posts:2779


01/25/2008 5:38 AM  
Hi Rodney,
Yes, I have the ability to do 301 re-directs ready in the new version. I'm currently working on a monitoring service to go with the module, but if you want to try out the latest code (still in beta) then send me an e-mail.

emilio
<20 Posts
Posts:4


01/29/2008 1:21 PM  

John,

I've just bought PageBlaster. How long before the release? I need the 301 Redirect functionality as I'm about to upgrade old DNN 1.0.10e site to DNN 4.6.2 and I need 301 Redirects too...

I might try the beta if the new release is not available before end of the week?

Thanks - Emil

Rodney
<100 Posts
Posts:64


01/29/2008 6:45 PM  
Thanks John - I need some help configuring the 301 side of things. I have 30 or so domain names that I want to point at a single one. How do I achieve this please? Also, will this affect performance with that many domains?
Host Account
<100 Posts
Posts:82


01/29/2008 9:09 PM  

Hi Emilio,

I should have the next release out this week.  If you want to test out the 301 Redirects before that then reply directly to the notification from this post and I'll send you the beta release.

 

Host Account
<100 Posts
Posts:82


01/29/2008 10:06 PM  

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.

Host Account
<100 Posts
Posts:82


01/29/2008 11:09 PM  

I forgot to mention how this rule should be entered into the interface.

Here's a couple images to help explain.









emilio
<20 Posts
Posts:4


01/30/2008 5:29 AM  

Hi John,

my 301 redirect scenario is mainly translating old specific module urls to new to new url format with different ids where regex can not be used as it's one to one redirection.

My questions:

  1. What is the best/efficient way to enter a list of one to one redirects? For example: /EditModule.aspx?tabid=22&def=details&id=198   -->  /properties/tabid/75/type/view/id/5/default.aspx
  2. How is performance affected or which PB redirect rules are more efficient/preferred?
  3. Is elseIF construct supported? For example is this allowed: [PB: IF(...){...}elseIF(...){...}else{...}]

My initial idea for the above scenario was to write custom 404 page where to sniff the requested url and issue 301 Redirect only when match is found. Now I'm looking if I could use PB to accomplish this...

John Mitchell
Posts:2779


01/30/2008 9:06 AM  
Hi Emilio,

I'm not sure what you are trying to accomplish here. Will tabid=22 always go to tabid=75?
You may be able to do your rules in a PB module placed on a specific page (tabid=22).
That way they will only be running on that page instead of for the whole portal.
The example you gave looks like it would be better handled in the module itself, but I'm probably just missing something.

No, ElseIF is not supported, but you could put several IF conditions one after the other in the same rule to get the same effect.
PageBlaster would evaluate each one in order so it would be like a Select Case statement since you would be breaking out of it with the Response.End
emilio
<20 Posts
Posts:4


01/30/2008 1:54 PM  

Yes tabid=22 always goes to tabid=75

I have an old site with a property module sitting on tabid=22 and new site with upgraded module with different ids for the same content

When the new site goes live most of the old ids need to be redirected to the ones on the new site - for example:

OLD:  /EditModule.aspx?TabID=22&def=Details&ID=565

NEW: /Properties/tabid/75/Type/View/ID/1/Default.aspx

where tabid 22 is always 75, but old id 565 is 1 in this case or 570 is 10 and so on not more then 20-30 redirects.

I hope this makes sense now!

So my question is how PB can help me to achieve 301 redirects for the old site urls to the new one?

John Mitchell
Posts:2779


01/30/2008 5:57 PM  
You would need to capture it at the Portal Rules since you probably don't have a tabid=22 to put a PageBlaster module on your new portal.

It would be much better if your Id's on the new Url could correspond to the same ones on the old urls.
Can you change the Id's of those records in the DB for the new portal so they match the old ones? i.e. change ID 1 to ID 565 ?

If not then you could just do multiple IF statements to match the old Urls and redirect to the new Urls

[PB: IF( Match("[PB:Request.Url]","EditModule.aspx?TabID=22&def=Details&ID=565") ) {

[PB: Response.Status("301 Moved Permanently") ]

[PB: Response.AddHeader("Location","http://www.yourdomain.com/Properties/tabid/75/Type/View/ID/1/Default.aspx") ]

[PB: Response.End() ]

} ]


John Mitchell
Posts:2779


02/03/2008 10:54 AM  

Hi Everyone,

I just updated the attached image in this thread because search for a period turned out to not be such a good idea.
The reason being that if you search for a period in the search For part of the rule, and the condition is not matched in the Respond - Replace With part then the rule will replace everything with nothing.

So it is better to search for a known element in the output, and then replace that element in the ELSE part of a Conditional Rule.

There will also be further discussion of the new version in the following thread:
http://www.snapsis.com/PageBlaster-Support/tabid/601/forumid/9/postid/8315/view/topic/Version-3-0-Beta-Test-FeedBack.aspx

Please use that thread for any clarification or discussion of new features.

Please Register to post a reply. Another benefit of registration is the ability to subscribe to and recieve notifications of new posts.
Forums >Snapsis Product Support >PageBlaster > 301 Redirect feature for PageBlaster?



ActiveForums 3.7
Powered by: Snapsis Software