eriksalt wrote: |
|
I have looked into the docs, but haven't found this yet, sorry if this is something I should know...
I have a DNN site, and a page on that site that holds my blog, whose name is 'SimpleBlog', but the URL to this page is something like "http://blogs.xxxxx.com/SimpleBlog/tabid/61/Default.aspx" I would like to access this page through some simpler page name like "http://blogs.xxxxx.com/SimpleBlog.aspx" is there any way to get DNN to give a simpler name like this to my page?
Thanks, Erik |
|
We were able to accomplish this by adding a RewriterRule entry into the existing siteurls.config file (in the DNN root folder), as shown:
<RewriterRule>
<LookFor>.*/shoppingcart.aspx</LookFor>
<SendTo>~/default.aspx?tabid=64</SendTo>
</RewriterRule>
The LookFor is a regular expression matching pattern - in this case, look for the page name "/shoppingcart.aspx" preceded by any other characters (.*). The SendTo is the replacement string, also a regular expression. In this case, use the default root (~) followed by the target page name and any parameters needed.
You can also use part of the matched pattern in the resulting string, as shown here:
<RewriterRule>
<LookFor>.*/(.+)_training.*</LookFor>
<SendTo>~/default.aspx?tabid=54&category=$1</SendTo>
</RewriterRule>
This expression will take a URL that ends in "/asp.net_training.aspx" and the result will be the same URL ending in "/default.aspx?tabid=54&category=asp.net". See the .NET documentation for more about regular expressions. You can see this in action on our web site at
www.bluestarlearning.com.
This works in DNN 3.0.13 with or without Friendly URLs turned on. I saw a thread that indicated that this no longer worked in DNN 3.1 if Friendly URLs were off, but have yet to test this.
Ted