Better URLs With Subtext and Windows Live Writer

subtext 0 comments suggest edit

One feature of Windows Live Writer that Subtext supports is the ability to edit your post slug? What is the URL slug associated with a blog post? What is the URL slug?

Take a quick look in the address bar and you should notice that the URL ends with “editing-post-slugs.aspx”. That bold part is the post slug. It’s a human friendly URL portion that identifies this blog post, as opposed to using some integer id.

For a long time, Subtext had the ability to automatically convert your blog post title into friendlier URLs. However, as with most automatic efforts, there are cases where it falls a bit short.

For example, suppose I started writing the following post with the following title:

editing-post-in-wlw

When I post it, the URL ends up being a bit ugly, though Subtext does give a good faith effort.

ugly-url-subtext

With Windows live writer, there’s a little double hash mark at the bottom that you can click to expand, providing more options. In the Slug: field, enter a cleaner URL.

editing-slug-in-wlw

Now when you publish this post, the URL will end with the slug that you specified.

If you use the Subtext Web Admin to post, we’ve had this feature all along in the Advanced Options section. It’s the Entry Name field (which I think we should call Entry Name Slug since Slug seems to be the standard term for this.

Of course when we come out with our MVC version, we can get rid of that annoying .aspx at the end. :)

Technorati Tags: subtext,windows live writer,wlw

Found a typo or error? Suggest an edit! If accepted, your contribution is listed automatically here.

Comments

avatar

16 responses

  1. Avatar for Mihai
    Mihai August 13th, 2008

    Yeah.. when are you going to come out with the MVC ? It's a great thing you've done already.. can't wait till it's all done ( maybe you should do a MVC beta and let it stay like that >:D )

  2. Avatar for Sid Savara- Personal Developme
    Sid Savara- Personal Developme August 13th, 2008

    That's awesome! That's one of the reasons I have been using the Wordpress backend for my blog, I installed a plugin that essentially does the same thing - although I LOVE Windows Live Writer, I had similar issues to the one you showed. Very cool!

  3. Avatar for Mohammad Mahdi Ramezanpour
    Mohammad Mahdi Ramezanpour August 13th, 2008

    DotNetBlogEngine has also the same feature. But I've never think about using ASP.NET MVC in blogging systems. By the way, I have a question Phil. What is the best blog engine in your opinion?

  4. Avatar for alberto
    alberto August 13th, 2008

    Cool. That's something I've been missing from blogspot. I always have to post and edit the title to get it the way I want.

  5. Avatar for scott
    scott August 13th, 2008

    @Mohammad
    I would be supprised if he says anything besides subtaxt as he is its founder :). But if you want my opinion and your looking for .net I like both subtext, and dotnetblogengine. I think subtext is a little bit more light. But i haven't looked at it latley.

  6. Avatar for haacked
    haacked August 13th, 2008

    Heh, I am a totally biased opinion, but I like Subtext. :) However, I have heard a lot of good things about DotNetBlogEngine and know that Mads (who runs it) is a good guy and very smart.

  7. Avatar for Charles Nurse
    Charles Nurse August 13th, 2008

    Sorry - Phil. But I use BlogEngine.NET too. I like the fact it supports XML as its Data Store. And I can do the same as you describe here with Windows Live Writer.

  8. Avatar for Scott Muc
    Scott Muc August 13th, 2008

    For the site I work on we do the automatically urlize our blog entry titles. The biggest issue for us was when the title had to be changed days later. This caused some non permanent permalinks to go out in the wild. I firmly believe in readable urls and don't consider putting a GUID there to be a good solution.
    How do you feel about a history of slugs per post being stored? When an old slug was hit and permanent redirect can be done to the url of the latest slug is done. Do you think this is a reasonable solution to this problem, or is there not enough benefit for the work?
    Thanks,
    Scott

  9. Avatar for Pete
    Pete August 13th, 2008
    Of course when we come out with our MVC version, we can get rid of that annoying .aspx at the end. :)


    You forgot the asterisk... * = if you have IIS7, which no web-hosts has, except for one or two beta-testing.
    You or someone from your team really should write an article on making MVC useful on IIS6, which will unfortunately be the standard for at least a couple of years.

  10. Avatar for Skip Hire
    Skip Hire August 13th, 2008

    Nice. Do you have a way of getting rid of the .aspx though?
    Personally I don't think it is good to give away anything about your server. Unfortunately I don't have a dedicated host, so I can't get rid of those tell tale server footprints. However, on my home box, I block the server and I forget what its called now, the one that tells you what programming language is being used headers. I also never have any file extensions on the URLs, all indexes are disabled, so people can't browse your files, anything that contains server-side code is totally blocked from direct access and if you try typing in index.php/asp/aspx/cfm ... you just get redirected.
    Might sound extreme, but security is paramount in my opinion.

  11. Avatar for Dr Saxe
    Dr Saxe August 16th, 2008

    Being a newbie is becoming a challenge - but interesting along the way. I can tell you that I wasn't even aware of what "slugs" were all about, glad to have found some useful info that will help get this old man up to speed. Glad that I was told to use WordPress for my Blog, I'm hearing a lot of good things about it, such as what you and your readers have stated here.
    Respectfully,
    Dr Saxe

  12. Avatar for Tim Marman
    Tim Marman August 16th, 2008

    Phil, why would you need to wait for MVC to take away the aspx extension? Just add the ASP.NET ISAPI as a wildcard handler on the virtual directory (which you would presumably need to do anyway at some level for MVC, though admittedly I haven't played with it much), and you can write a very simple HTTPHandler that redirects accordingly.
    I'm doing this on Notches - e.g., http://notch.es/about really maps to http://notch.es/about.aspx. I'm not using a full IISRewrite or similar module - rather a really small one that just checks if the url doesn't end in .*, and if a corresponding *.aspx exists, then rewrites the request accordingly.
    Slightly more overhead than not mapping the requests directly, but like I said I would guess this is necessary with the current infrastructure in MVC anyway no?

  13. Avatar for haacked
    haacked August 16th, 2008

    @Tim with Subtext, we've tried to keep deployment as simple as possible. Unfortunately, wildcard mappings is not something we can x-copy deploy. When such things are controlled via web.config (as it is with IIS 7), then we can rely on that within Subtext.
    We didn't want to pile-up manual steps. But yes, you are correct in that we could do this now. But with the MVC version of Subtext, we're targetting a future in which IIS 7 is prevalent and our supported web server.

  14. Avatar for Dave Schinkel
    Dave Schinkel September 7th, 2008

    Subtext is way better in terms of functionality it offers, how you set it up, and compatibility with plugins these days. So I prefer subtext. I think though Subtext is moving in the right direction by offering more common plugins out of the box and the UI needs some more eye candy is all.

  15. Avatar for Salvador ALicea
    Salvador ALicea September 8th, 2010

    Thank you for this imformation. I was looking to how to improve the SEO for my blog and using slugs with the right keywords is one of the ways.

  16. Avatar for Escorts in Atlanta
    Escorts in Atlanta October 14th, 2011

    The data is extremely helpful to my needs and i have find solution just after i implemented your ideas.