making user friendly urls in a cms
I am interested in the architecture of a CMS where i can pass a full URL instead of a query string.
I would like to make a site that could ha开发者_JAVA技巧ndle a request to any page... Say 'http://www.my-domain.com/directory/page.aspx' and have the resulting response deliver a generic page/file.
I would like the request to be passed through an XML document where i could store page names and the corresponding file to render content...
My question specifically
- Is this possible
- Is it easy to do
- Are there any Links people have on hand they could share with me on the how to's.
- Any pro's or cons you may have come across if you have used this method.
Yes, it's possible, and reasonable easy. Most CMSes do it this way, but use a database instead of an XML file.
You should probably look into URL rewriting. The concept is to separate the URL structure from the actual filesystem representation.
For .NET: UrlRewriting.Net is a gem.
However, since there are hundreds of fantastic CMSes already out there like you describe, I'd suggest using one of them and saving yourself work. Provide more detailed requirements and I can suggest one.
精彩评论