Good morning, I am trying to setup urlrewriting on Tim Geyssen's blog package. Essentially I want to redirect the URL away from the date based URL and make it a more simple format like /blog/postname.aspx. A more specific example is below.
/blogtest/2009/9/1/test-post---welcome.aspx
to...
/blogtest/test-post---welcome.aspx
I am using the config/UrlRewriting.config file to enter the rules and it seems to be trying to do this rewrite, but it seem like maybe it's trying to do a redirect instead. Here is the rule I am using...
No umbraco document matches the url 'http://kylepauljohnson.com/myblog/test-post---welcome.aspx'
umbraco
tried this to match it using this xpath query'/root/node/node [@urlName
= "myblog"]/node [@urlName = "test-post---welcome"] | /root/node
[@urlName = "test-post---welcome"]')
This page can be replaced
with a custom 404 page by adding the id of the umbraco document to show
as 404 page in the /config/umbracoSettings.config file. Just add the id
to the '/settings/content/errors/error404' element.
Mmm, the most obvious question first... Do you have a /myblog page? You seem to redirecting to that one, but might think you want to redirect to /blogtest instead of /myblog?
So maybe my "greenness" comes out here. But shouldn't the URLRewrite simply mask the page that is there? So essentially the origianl page is loaded but with the alternate alias?
I am not looking to redirect so much as just give it a friendlier URL. i.e. remove the date folder levels.
you can use umbracoUrlAlias to achieve the alterate url you are speaking of... have a text field on the blogpost docType and you can specify anything for that alias.
however, i am interested in shortening the url by removing the date folder, so interested to hear what more experienced devs hav to say.
@bob baty-barr Right, I did look into this method and did get it to work sucessfully, however I was hoping for a more automated approach, thus the URLrewriting.
I don't mind the folder organization in the CMS itself, I would just like it organized more cleanly for the visitors.
@kylepauljohnson... exactly... i am hoping someone can point us in the right direction with urlrewriting... i have only created very basic rules and am not very familiar with how to address this challenge.
First: do you need the folder organization in the backend? If no, then you can alter the blogpackage to not use the folders. Which will automatically result in the URL's you want. (But, you get a lot of content in 1 folder if you get a lot of blogposts).
Second: Again, alter the blogpackage so that the nice-URL gets created automagically when you create a new post.
I think the second one is the easiest to accomplish. Maybe other have some other ideas though.
AFAIK, url rewriting won't help here. As Bob pointed out, umbracoUrlAlias is a viable solution, which essentially is the same as writing a not found handler for your installation. Such a handler kicks in whenever no matching page can be found.
If you want to have the umbracoUrlAlias populated for each new blog post, I'd suggest to write up an event handler that checks that fires on document creation and set the property value accordingly.
Have a look at the event samples available on the wiki
Rewrite Seems to Redirect Instead?
Good morning, I am trying to setup urlrewriting on Tim Geyssen's blog package. Essentially I want to redirect the URL away from the date based URL and make it a more simple format like /blog/postname.aspx. A more specific example is below.
/blogtest/2009/9/1/test-post---welcome.aspx
to...
/blogtest/test-post---welcome.aspx
I am using the config/UrlRewriting.config file to enter the rules and it seems to be trying to do this rewrite, but it seem like maybe it's trying to do a redirect instead. Here is the rule I am using...
and here is the response I get when I test this. Thoughts? Help?
---------------------------------------------------------------------------------
Page not found
No umbraco document matches the url 'http://kylepauljohnson.com/myblog/test-post---welcome.aspx'
umbraco tried this to match it using this xpath query'/root/node/node [@urlName = "myblog"]/node [@urlName = "test-post---welcome"] | /root/node [@urlName = "test-post---welcome"]')
This page can be replaced with a custom 404 page by adding the id of the umbraco document to show as 404 page in the /config/umbracoSettings.config file. Just add the id to the '/settings/content/errors/error404' element.
For more information, visit information about custom 404 on the umbraco website.
This page is intentionally left ugly ;-)
Mmm, the most obvious question first... Do you have a /myblog page? You seem to redirecting to that one, but might think you want to redirect to /blogtest instead of /myblog?
/Dirk
hmm... i am kinda curious about this one too... i tried updating the rule above, but also got 404...hmmm
So maybe my "greenness" comes out here. But shouldn't the URLRewrite simply mask the page that is there? So essentially the origianl page is loaded but with the alternate alias?
I am not looking to redirect so much as just give it a friendlier URL. i.e. remove the date folder levels.
you can use umbracoUrlAlias to achieve the alterate url you are speaking of... have a text field on the blogpost docType and you can specify anything for that alias.
however, i am interested in shortening the url by removing the date folder, so interested to hear what more experienced devs hav to say.
@bob baty-barr Right, I did look into this method and did get it to work sucessfully, however I was hoping for a more automated approach, thus the URLrewriting.
I don't mind the folder organization in the CMS itself, I would just like it organized more cleanly for the visitors.
@kylepauljohnson... exactly... i am hoping someone can point us in the right direction with urlrewriting... i have only created very basic rules and am not very familiar with how to address this challenge.
I think you have 2 options here:
First: do you need the folder organization in the backend? If no, then you can alter the blogpackage to not use the folders. Which will automatically result in the URL's you want. (But, you get a lot of content in 1 folder if you get a lot of blogposts).
Second: Again, alter the blogpackage so that the nice-URL gets created automagically when you create a new post.
I think the second one is the easiest to accomplish. Maybe other have some other ideas though.
HTH,
Peter
Hi,
AFAIK, url rewriting won't help here. As Bob pointed out, umbracoUrlAlias is a viable solution, which essentially is the same as writing a not found handler for your installation. Such a handler kicks in whenever no matching page can be found.
If you want to have the umbracoUrlAlias populated for each new blog post, I'd suggest to write up an event handler that checks that fires on document creation and set the property value accordingly.
Have a look at the event samples available on the wiki
Cheers,
/Dirk
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.