First, some detail on what I am doing...
I am having a situation with my CS 2.1 (ASP.NET 1.1) install and SiteUrls / url rewriting.
My goal is to do this:
www.example.com/fancy-url-name
and really send the user to:
www.example.com/Page.aspx?id=10
To do so, I have an entry in SiteUrls.Config that looks like this...
<url name="fancy-url-name" location="common" path="{0}.aspx" pattern="fancy-url-name" vanity="Page.aspx?id=10" />
After I set the wildcard (.*) association to aspnet_isapi.dll in IIS, this url rewriting works.
Enough backstory, here is the problem...
Unfortunately, the SiteUrls no longer knows what to do a url with no file at the end at all. For example, if you go to here:
www.example.comwww.example.com/www.example.com/subdirectory
It will get a page not found error... for example, in the first url I used asn an example (and the common one when someone enters your url in their address bar), you get this page:
www.example.com/error-notfound.aspx?aspxerrorpath=/
As you can tell, this is very bad.
My question is this: Is there a way I can do this extensionless url rewriting with SiteUrls that will not break my home path, etc. like this? Has anyone been able to do extensionless url rewriting with SiteUrls successfully?
Rather than all those changes I think you can do this easily with Ken Robertson's URL Rewrite mod?
It's definitely worth a look!
Rick Reszler
I'm working on similar issues. I have implemented a URL system for Community Server that does not use file extensions at all. (I do this only for the most important pages -- utility pages that are not likely to be indexed by search engines still use file extensions.)
My goal is to have completely "hackable" URLs, especially for blog posts.
The reason I want to do this is because I agree with Ian G's post on URL Dogma as well as Mike Amundsen's ideas about what makes a good URL.
Here is an example. From the blog post URL shown below, each URL segment can be hacked off and the resulting URL is valid and works as one would expect.
http://mydomain.com/blogs/myblog/2006/11/12/my-blog-post-name
http://mydomain.com/blogs/myblog/2006/11/12
http://mydomain.com/blogs/myblog/2006/11
http://mydomain.com/blogs/myblog/2006 (this one probably isn't ideal. Currently, I just show January for the year instead of showing the whole year)
http://mydomain.com/blogs/myblog
http://mydomain.com/blogs
http://mydomain.com
I have all of the above working. However, there are a few bugs still. For example, handling the query string for paging (e.g., ?p=2) isn't working yet. I expect to finish fixing the bugs I know about in the next few days.
I thought I read Ken say that his URL Rewrite mod is not intended for this type of solution. If his module will indeed handle this, I'd like to know - that would save me some work.
My solution is done almost entirely in SiteUrls.config. So far I have not had to modify anything else, but it is possible that a few other tweaks may be required as I fix up the remaining issues.
If anyone wants to take a peek at what I'm doing or help me test (and debug) it further, let me know.
davestechshop: My solution is done almost entirely in SiteUrls.config. So far I have not had to modify anything else, but it is possible that a few other tweaks may be required as I fix up the remaining issues.
I have my implementation working now and it has been in production for about 2 weeks. I did have to refactor one existing method in Community Server to complete my modification. Now that it is up and running, everything seems to be working fine so far.
As it is currently implemented, my Community Server blog URLs look like this (no "archive" and no file extensions):
For a full explanation of the advantages of this approach and instructions on how to do it see my blog post titled URL Dogma for Community Server.
I would appreciate any feedback, bug reports or suggestions.
Copyright© 2008 Telligent Systems Inc. All rights reserved CommunityServer.com • Telligent.com