Quick Nav:  Online Store   |   Login | Register

Replacements in Snapsis.PageBlaster.config

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
Ari Doucette
<100 Posts
Posts:58


08/28/2007 2:12 PM  
Thanks, John.
I tried just uncommenting the Providers section first, from the default config that came with the PageBlaster download. That crashed DNN.
What do you think I might be doing wrong here?
John Mitchell
Posts:3248


08/28/2007 2:18 PM  
Can you look in the log viewer and tell me if there were any errors logged? Or maybe an error was presented on the screen when it crashed?
Ari Doucette
<100 Posts
Posts:58


08/28/2007 2:31 PM  
The onscreen error was useless, as debug is false.
The event viewer shows:
AssemblyVersion: 04.05.05
PortalID: 0
PortalName: EVMServices.com
UserID: -1
UserName:
ActiveTabID: 36
ActiveTabName: Home
RawURL: /Default.aspx?base
AbsoluteURL: /Default.aspx
AbsoluteURLReferrer:
UserAgent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.1.4322; InfoPath.2; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30)
DefaultDataProvider: DotNetNuke.Data.SqlDataProvider, DotNetNuke.SqlDataProvider
ExceptionGUID: f9efebf5-d519-4750-b8ad-358814f98f93
InnerException: Unhandled Error:
FileName:
FileLineNumber: 0
FileColumnNumber: 0
Method: System.Xml.XmlTextReaderImpl.Throw
StackTrace:
Message: System.Exception: Unhandled Error: ---> System.Xml.XmlException: Data at the root level is invalid. Line 1, position 1. at System.Xml.XmlTextReaderImpl.Throw(Exception e) at System.Xml.XmlTextReaderImpl.Throw(String res, String arg) at System.Xml.XmlTextReaderImpl.ParseRootLevelWhitespace() at System.Xml.XmlTextReaderImpl.ParseDocumentContent() at System.Xml.XmlTextReaderImpl.Read() at System.Xml.XmlLoader.Load(XmlDocument doc, XmlReader reader, Boolean preserveWhitespace) at System.Xml.XmlDocument.Load(XmlReader reader) at System.Xml.XmlDocument.LoadXml(String xml) at Snapsis.HttpModules.PageBlaster.Config.Settings.Create(HttpApplication app, String settingsXML) at Snapsis.HttpModules.PageBlaster.Config.Settings.GetConfig(HttpApplication app) at Snapsis.HttpModules.PageBlaster.ResourceLocationController.RewriteVirtualPath(HttpApplication app) at Snapsis.HttpModules.PageBlaster.PageBlasterModule.BeginRequest(Object sender, EventArgs e) at System.Web.HttpApplication.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) --- End of inner exception stack trace ---
Source:

and another one with the same messag but GUID cbe5d242-dbce-4216-a703-ffbce004f7bf



Ari Doucette
<100 Posts
Posts:58


08/28/2007 2:32 PM  
John, should we move these to a new thread so we don't mess up the nice "Sticky" of page-blaster rules?
John Mitchell
Posts:3248


08/28/2007 2:37 PM  
Yes, I was going to split this out, and will do so now.

The error is saying that the XML is not formatted correctly, so look closely at what you have uncommented to make sure there is not an error.

If you want to uncomment it, and then attach the config file here then I can have a look.
Ari Doucette
<100 Posts
Posts:58


08/28/2007 2:59 PM  

If I uncomment the lines in the attached text file, DNN crashes as above.


Attachment: Snapsis.PageBlaster.config.txt

John Mitchell
Posts:3248


08/28/2007 3:07 PM  
It looks like the blank line at the top of the file is causing the problem.

Ari Doucette
<100 Posts
Posts:58


08/28/2007 3:45 PM  

I'm sorry, I don't see a blank line. What line are you referring to? I've tried opening it in Notepad and in Notepad++

John Mitchell
Posts:3248


08/28/2007 4:19 PM  
Sorry, that was my fault. I saw what looked like a blank line at the top when i just clicked on the link and it opened in the browser. After downloading I see that it does not have one.

I tried the file on my dev environment and it worked. I wonder if somehow the file is getting corrupted on your site when you upload it. The error says it is at the very beginning of the file.

You can also try putting an xml declaration at the top of the file:
<?xmlversion="1.0"encoding="utf-8"?>
Ari Doucette
<100 Posts
Posts:58


08/28/2007 5:55 PM  

Adding that declaration also didn't work.

Can you find anything wrong with the rules I've attached to this post? I just don't know what's going on.

Also, is there a sample config file I can download so I can get a handle on the CDATA and whatever else the XML file might require of me? Also so I can figure out the regular expressions and rules?


Attachment: Snapsis.PageBlaster.config.txt

John Mitchell
Posts:3248


08/28/2007 6:03 PM  
That default config file does have an exmple of replacement rules using CDATA.
Try removing that extra rule that is commented out.

If you want to contact me directly and have me take a look at your setup you can reply directly to the notification of the post.
Ari Doucette
<100 Posts
Posts:58


08/28/2007 7:07 PM  

>Try removing that extra rule that is commented out.

There wasn't anything commented out in the text file I sent you.

 

  1. Are there any instructions for creating rules?
  2. Is it OK to use tabs for indentation instead of spaces?
  3. Are the following two rules correct? I think that knowing what is wrong with these would go a long way to helping me figure out the rest:{rule}
        {ruleName}Remove base hack{/ruleName}
        {searchFor}default.aspx\?base${/searchFor}
        {replaceWith}{/replaceWith}
    {/rule}
    {rule}
        {ruleName}Remove email addresses{/ruleName}
        {searchFor}href=['"]?mailto:(\w+[a-zA-Z0-9.\-_]*)@(\w+)\.(\w+)['"]?{/searchFor}
        {replaceWith}href="window.location.replace('ma'+'ilto:'+'$1'+'@'+'$2'+'.$3')"{/replaceWith}
    {/rule}
    {rule}
        {ruleName}Make Friendlier URLs{/ruleName}
        {searchFor}(http[s]?://[^/]+)(/[^"]+)(/(?=tabid)[^"]+)/Default\.aspx(?!\?){/searchFor}
        {replaceWith}$1$3$2.aspx{/replaceWith}
    {/rule}

Thanks for the help. If there is an instruction manual for the rules, that would go a long way...

 

John Mitchell
Posts:3248


08/28/2007 10:04 PM  

No, there are not any specific instructions for creating rules.  They are very configurable and there is an example format in the default config.  I'm also willing to help whenever possible.

Yes, it is ok to use tabs instead of spaces in the configuration file.

Yes those rules are correct, but after testing I found a syntax problem on the "remove base hack" one. It does not require the $ at the end of the search for string.

I am attaching a default config file with all these rules in it for you to use.  I have tested it locally so it should work by just copying it to your website root folder.


Attachment: Snapsis.PageBlaster.config.txt

Ari Doucette
<100 Posts
Posts:58


08/29/2007 5:58 AM  

Mitch,

The file you gave me worked just as it should. I guess the CDATA is where I was going wrong?

Thanks so much for your help!

Also, one thing I did notice while we were going back and forth with the config.txt files: It seems that if there are more than one files with the same name in the same thread in these forums, only the newest one will show. So if you click on the links for the previous files, they only show the new one. I'm using activeforums also, so I'll need to check my own site for this one as well.

Thanks again,
Ari

John Mitchell
Posts:3248


08/29/2007 7:24 AM  
Excellent, I'm glad it's working. It may have been a problem with CDATA, but I didn't see a problem with your other examples.

That's correct about the file attachments. There is a place in the ActiveForums config when you allow attachments to make them all unique. I need to set that.

Thanks,
John
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 > Replacements in Snapsis.PageBlaster.config



ActiveForums 3.7
Powered by: Snapsis Software