简体   繁体   中英

DotNetNuke URL rewrite issue

I would like to shorten this: http://www.example.com/desktopmodules/imm/ims_cddetail/playtrack.aspx?trackid=18353

to http://www.example.com/playtrack/18353

IIS is no help. It suggests http://www.example.com/trackid/18353 and when I choose that, it doesn't work anyway.

I created a virtual IIS directory in the main site called "playtrack" and pointed it to the proper path. But, I still am left with http://www.example.com/playtrack/playtrack.aspx?trackid=18353 .

Any suggestions?

I was looking in completely the wrong place. Dotnetnuke's Configuration Manager has a section called SiteUrls. I simply entered a rule in that:

<RewriterRule>
  <LookFor>[^?]*/playtrack/(\d+)</LookFor>
  <SendTo>~/desktopmodules/imm/ims_cddetail/playtrack.aspx?trackid=$1</SendTo>
</RewriterRule>

I suggest you to read https://msdn.microsoft.com/en-us/library/cc668201.aspx , you will find everything that you need about the url in aspx. You must create custom route type, for more info please read the documentation of microsoft. Especially your question is answered in the topic which called "Adding routes to a web form application".

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM