Custom URL Scheme

Topics: Support Request
Nov 20, 2008 at 1:35 AM
Hey,

This is essentially a reask of a question (still unanswered) that I posted over at Stackoverflow (http://stackoverflow.com/questions/300989/custom-url-scheme-in-dasblog).

I really need some help on this one. I am trying to change the shceme that dasBlog uses for its posts, or at the least somehow setup a 301 redirection from my old URLs to my new URLs. You see, what has happened is that I have upgraded my version of dasBlog from 2.0 to 2.2 (and at the same time IIS from 6 to 7) and my post Urls have gone from YYYY/MM/DD/A+Post+Title.aspx to YYYY/MM/DD/APostTitle.aspx.

Normally this little detail would matter as much as it does, except that I have many incoming links (both from internal and external sources) that are now 404ing when people visit my site. It has been pointed out to me that IIS7 does not like the plus sign in the URL and blocks those by default. Fortuantly, however, it appears that my hosting provided has configured IIS7 to allow such URLs. 

I have written an HttpModule that I hooked up to the BeginRequest event and tried to do some Regex matching on the URL to do my own redirections. The module ran just fine until I tried to access a page that should have been redirected. Then the module appeared to stop working entirely (almost like it was unregistered ?). So not really knowing the internals of dasBlog and if maybe its own URL rewritting module was conflicting with my module I decided to instead invistigate using the existing URL rewriting system in dasBlog to my advantage. However my many attempts at adding custom rules to the newtelligence.DasBlog.UrlMapper section of the web.config yielded no results, perhaps due to my ignorance of how it works.

Please someone help me with this. The traffic to my site has be cut to a fourth of what it was originally.

Thanks,
Jason Whitehorn
Developer
Nov 20, 2008 at 5:54 AM
I don't think the request is ever making it to dasBlog. It sounds like IIS is still blocking the + signs, which would explain why your module doesn't work eather (IIS is stoping the request before it even gets there).

TitleMapperModule is responsible for the URL rewriting, it is turning the request you are talking about into ?date=yyyy-mm-dd&title=YourPostTitle.

dasBlog should work with or without the + signs because it strips them out before it compares the tile in the query string to the title of your entries.
string compressedTitle = entry.CompressedTitle.Replace("+", "");

What if you upload a file like test+file.txt?  Does the web server properly display the file?  If not then it is an IIS issue.



Nov 20, 2008 at 1:12 PM
Ah crud!

I was in such a hurry to solve this problem that I overlooked the easiest way to debug it. I uploaded the text file as you suggested, and no beans. IIS is still blocking. I just assumed when it was returning a 404 (not a 404.11) that ment that the request was not being blocked. Thanks for the help, I was so certain the request wasn't being block... perhaps it was just hope.

Since I can't get my old URLs back, how do I go about changing the URLs to have some space seperate (instead of a jumble of words)? I noticed this post (http://www.codeplex.com/dasBlog/Thread/View.aspx?ThreadId=34394) discussing an upcoming patch to allow dashes, but doesn't appear to have made it into 2.2 (or atleast I can't figure out how to find the configuration setting).

Thanks again!
Developer
Nov 21, 2008 at 3:06 PM
Hi Jason,

As you have noted the URL patch did not make it for 2.2. So, the only way you can get it, is to download and build the source from the trunk. From a quick scan, it looks like the URL patch and some other bits and bobs were merged in by Paul in rev 16192. So you could get this rev and build it.

Alternatively, if you want 2.2 plus the URL patch ONLY, you could get the source for 2.2 and patch it yourself with the URL patch 1866 listed here http://www.codeplex.com/dasBlog/SourceControl/PatchList.aspx

Cheers,

Ben

On Thu, Nov 20, 2008 at 1:12 PM, jwhitehorn <notifications@codeplex.com> wrote:

From: jwhitehorn

Ah crud!

I was in such a hurry to solve this problem that I overlooked the easiest way to debug it. I uploaded the text file as you suggested, and no beans. IIS is still blocking. I just assumed when it was returning a 404 (not a 404.11) that ment that the request was not being blocked. Thanks for the help, I was so certain the request wasn't being block... perhaps it was just hope.

Since I can't get my old URLs back, how do I go about changing the URLs to have some space seperate (instead of a jumble of words)? I noticed this post (http://www.codeplex.com/dasBlog/Thread/View.aspx?ThreadId=34394) discussing an upcoming patch to allow dashes, but doesn't appear to have made it into 2.2 (or atleast I can't figure out how to find the configuration setting).

Thanks again!

Read the full discussion online.

To add a post to this discussion, reply to this email (dasBlog@discussions.codeplex.com)

To start a new discussion for this project, email dasBlog@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe or change your settings on codePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at codeplex.com




--
Ben Taylor
http://bentaylor.org/
Coordinator
Nov 21, 2008 at 6:37 PM
You can also get release 16192 in the daily builds.

http://dasblog.info/dbftp/dasBlog-2.3.8282.16192-Source.zip

http://dasblog.info/dbftp/dasBlog-2.3.8282.16192-Web-Files.zip

Tom
Nov 22, 2008 at 4:47 AM
Thank you all for your help.

I have just downloaded the daily build of 2.3 (web files) from the links above and have deployed them without any difficulties.

I now have URLs I can live with :-)