Quick Nav:  Online Store   |   Login | Register

Pageblaster v3.x questions

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
OM
<50 Posts
Posts:35


04/05/2008 4:14 AM  

Hi John, I have some questions before I buy :)

1. Can pageblaster be run on other ASP.NET (not DNN) .. yes I know about the pageblaster.NET, but that doesnt do URL rewrite does it?
2. Can I rewrite a url that doesnt exist? eg www.example.com/page-that-has-been-deleted.aspx to www.example.com/new-page.aspx
3. Can I rewrite the protocol? eg I want to rewrite https to http

Thanks a lot! ... I have 2 DNN sites and 1 non DNN site that can really use your module ... if it can do the above :)

OM.

John Mitchell
Posts:3268


04/05/2008 5:43 AM  
Hi OM,
Yes, the PageBlaster HttpModule can be used on any site, and you can use the global config file to control caching, compression, and global replacements (all pages).

The DNN module interface allows you to set the caching, replacements, and some other options at the portal and page level.

For a regular ASP.Net that is not DNN, the global configuration would be equivalent to the Portal configuration (since it probably does not have virtual portals).

For the URLRewrite part of question#1, the answer is that PageBlaster can be configured to do the same Virtual-Path functionality, but you would have to update the ResourceLocationTable.config file manually. The DNN Module updates that config file to do those virtual paths and maps a tab to the virtual path, so you would have to do the mapping for your other app manually. This process is roughly the same as how the SiteUrls.config file works except it doesn't use Rules with wildcards, it is a dirrect mapping of a virtual path to an internal Url.

For #2 the answer is yes. That is why I call them virtual paths.

For #3, you could Redirect (instead of Rewrite) to a secure protocol on the Url.

Keep in mind that rewriting a Url is a two step process in PageBlaster. The first step is mapping the virtual path to an internal Url and the second (optional) step is to replace any dynamically generated Urls that are in the output of your pages with your new virtual path. This is done in two steps to allow you the most flexibility in making virtual paths.

OM
<50 Posts
Posts:35


04/06/2008 4:42 PM  

Hi John,

Sorry it was late at nite when I wrote my post :) I meant to say:

2. Can I 301 redirect a url that doesnt exist? eg www.example.com/page-that-has-been-deleted.aspx to www.example.com/new-page.aspx
3. Can I 301 redirect based on the protocol? eg I want to redirect most https requests to http

I've been reading your post about how 301
redirects are done.. http://www.snapsis.com/PageBlaster-Support/tabid/601/forumid/9/postid/7958/view/topic/301-Redirect-feature-for-PageBlaster.aspx.

It seems like a strange way to implement this - that we have to search for some text in the html and then use an IF statement to change the response.status to 301.  What if the URL does not exist (see #2 above).. then no page will be served, and there is no html to search?  Also what if I have around 200 old URLs to check?

Shouldnt it be implemented as a feature that checks the incoming request.URL and then does a 301 if it regex matches a rule? eg

< rule type="301" from="/old-page.aspx" to="/new-page.aspx"  / >

OM

John Mitchell
Posts:3268


04/06/2008 7:38 PM  

Sure, the 301 redirect in PageBlaster can check the incoming URL, and because of the way it is implemented in a declarative way you can also use any number of other request properties to do your redirect (or even respond differently because of the text in the page).  This gives you all the same flexibility that you would have if you could write server side code.

The actual page does not have to exist for Portal Rules in PageBlaster to check the Requested Url because the engine behind PageBlaster is an HttpModule.

To check 200 Urls you can probably combine a lot of them together using a Regular expression to match the Url and do your redirect. Since the feature is implemented the way it is you can grab portions of the old Url and use them in the Response.Location part of the rule.

Your idea for the simple rule expression you show as an example is actually very close to how the virtual-path is done in PageBlaster. If you look at the DesktopModules/Snapsis?PageBlaster/Config/RespourceLocationTable.config file after adding a virtual path you will see what I mean.
That implementation does not allow 301 redirects though, it does a rewrite of the requested Url inside the application without redirecting.

If I were to do something simple like that for 301 redirects, how would you suggest it be entered in the interface?
Maybe with a more simple line that can be used in the SearchFor field something like this?:

[PB:Redirect(type, from, to)]

That would give the ability to do 301 or 302 redirects in one line of code.

For right now it is only a few more lines that can be easily copied and pasted though.  You could even put several in one rule like that other thread explained.

[PB: IF( Match("[PB:Request.Url]","OldPage1.aspx") ) {

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

[PB: Response.AddHeader("Location","http://www.yourdomain.com/NewPage1.aspx") ]

[PB: Response.End() ]

} ]

[PB: IF( Match("[PB:Request.Url]","OldPage2.aspx") ) {

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

[PB: Response.AddHeader("Location","http://www.yourdomain.com/NewPage2.aspx") ]

[PB: Response.End() ]

} ]

[PB: IF( Match("[PB:Request.Url]","OldPage3.aspx") ) {

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

[PB: Response.AddHeader("Location","http://www.yourdomain.com/NewPage3.aspx") ]

[PB: Response.End() ]

} ]

[PB: IF( Match("[PB:Request.Url]","OldPage4.aspx") ) {

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

[PB: Response.AddHeader("Location","http://www.yourdomain.com/NewPage4.aspx") ]

[PB: Response.End() ]

} ]

[PB: IF( Match("[PB:Request.Url]","OldPage5.aspx") ) {

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

[PB: Response.AddHeader("Location","http://www.yourdomain.com/NewPage5.aspx") ]

[PB: Response.End() ]

} ]

John Mitchell
Posts:3268


04/06/2008 7:41 PM  

By the way, if the example pages above really were that easy then you could combine all those into one like this:

[PB: IF( Match("[PB:Request.Url]","OldPage(\d+).aspx") ) {

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

[PB: Response.AddHeader("Location","http://www.yourdomain.com/NewPage$1.aspx") ]

[PB: Response.End() ]

} ]

OM
<50 Posts
Posts:35


04/06/2008 9:32 PM  

Thanks, I will probably be buying one license to try it out, and then a couple more for another 2 sites if it does work out.

I still didnt quite understand from the posts above, how it can do a 301 rewrite on a page that does not exist?  In the example you search for something that you know will be in the html eg < / head >.  But if a page does not exist then there will be no < / head > for it to find, ... or will there?  

Btw, it just feels somehow wrong to be searching for a piece of html that you already know will exist, and then to make some action that has no relation to the html that was just located ;)  I have 10 years+ coding experience, so this feels like a hack or work around

I really wouldnt mind too much how it is entered in the UI, just as long as it does a comparison against the incoming requst.url instead of searching for < / head >

As it is I will probably use another open source project for the 301 rewrites.  But dont worry,  I still need PB for caching, compression and css+js merging :)

Thanks

OM

Host Account
<250Posts
Posts:100


04/06/2008 9:58 PM  
Searching for the /head text works on a page that is not there because even a 404 response page has a head section when coming from ASP.Net.

I'll admit that the 301 responses are only an add-on feature and I can see why it would feel like a hack when you are coming at it new (especially as a programmer). I actually struggled with that as I implemented this enhancement and even had a lot of code written to do a completely different section and config file for this feature called "Url Responses". But as I was working this into the existing code I decided that it would be better for performance for everything to get executed in the existing enumeration of the rules instead of having to maintain a different collection of rules for a very limited specific purpose. And as I thought about it more I saw many possibilities beyond doing 301 responses by exposing the functionality in a declarative way.

By the way, the IF condition syntax and all the code can also be put in the Search For field if that helps it feel more right.

Having the conditional syntax makes those two fields very powerful in mine opinion.

I'll probably be added something to the UI to hide some of the "ugliness" that you are seeing in that implementation. Maybe I'll make different rule types that have different input fields, but then add them into the same back-end.


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 > Pageblaster v3.x questions



ActiveForums 3.7
Powered by: Snapsis Software