Register   Login
     
  Latest Posts  
RE: Different skin for View Item?
by cchufook on 7/03/2009 10:29 PM
RE: Different skin for View Item?
by swebster on 7/03/2009 10:10 PM
Different skin for View Item?
by cchufook on 7/03/2009 8:13 PM
RE: Human friendly URL not working--Urgent
by Madz on 7/03/2009 11:26 AM
RE: Friendly URL and DNN4.8.0 ?
by Madz on 7/03/2009 11:25 AM
Human friendly URL not working--Urgent
by Madz on 7/03/2009 11:11 AM
RE: Google Sitemap Revisited
by georgelew on 7/03/2009 4:26 AM
RE: Strange error in PropertyAgent Latest
by smcculloch on 7/03/2009 3:39 AM
RE: Strange error in PropertyAgent Latest
by georgelew on 7/03/2009 3:32 AM
RE: Lightbox Download Link bug
by smcculloch on 7/03/2009 1:48 AM
  Forums  
Subject: URLSiteUrls Rule problem
Prev Next
You are not authorized to post a reply.

Author Messages
WEBPCUser is Offline
Gold Membership
Nuke Super Newbie
Nuke Super Newbie
Posts:22

10/13/2005 1:59 PM  
Hi
I am having my first go at writing some custom rules and they aren't working and I don't know why!

I am trying to get users to be able to logon and logoff by going  a address such as:
http://mydnnsite/logon. 

The following are the 2 rules I have created in SiteUrls.config

        <RewriterRule>
            <LookFor>*/Logon</LookFor>
            <SendTo>~/Default.aspx?tabid=$1&ctl=logon</SendTo>
        </RewriterRule>
        <RewriterRule>
            <LookFor>*/Logoff</LookFor>
            <SendTo>~/Admin/Security/Logoff.aspx?tabid=$1</SendTo>
        </RewriterRule>

Can someone tell me where I am going wrong please?  I am using DNN 3.1.1

Thanks
Antony
Scott McCullochUser is Offline
Administrators
Nuke Master
Nuke Master
Posts:14659


10/13/2005 4:05 PM  

Try:-

<RewriterRule>

<LookFor>.*/Logon.aspx</LookFor>

<SendTo>~/Default.aspx?ctl=login</SendTo>

</RewriterRule>

<RewriterRule>

<LookFor>.*/Logoff.aspx</LookFor>

<SendTo>~/Admin/Security/Logoff.aspx</SendTo>

</RewriterRule>


Scott McCulloch
Site Administrator
WEBPCUser is Offline
Gold Membership
Nuke Super Newbie
Nuke Super Newbie
Posts:22

10/13/2005 4:35 PM  
So I take it you have to look for a file eg logon.aspx and cannot use just a folder?
Antony
Scott McCullochUser is Offline
Administrators
Nuke Master
Nuke Master
Posts:14659


10/13/2005 4:42 PM  

It has to be something mapped to the aspnet process (to be rewritten by aspnet), so if you piped all requests through the aspnet process, then logon would work. This is the reason we create folders for sub-portals.

By default, images, html documents, etc are not piped through the aspnet process for performance reasons.


Scott McCulloch
Site Administrator
ty aUser is Offline
Gold Membership
Nuke Active Member
Nuke Active Member
Posts:35


10/13/2005 9:20 PM  
hi Scott,
i have personal pages (tabs) on my site.  i'd be nice to give each user a friendly url for the area on the site eg http://www.mydnnsite.com/username.  i've tried...is this possible with rewrite rules?
Scott McCullochUser is Offline
Administrators
Nuke Master
Nuke Master
Posts:14659


10/14/2005 3:22 AM  

Depends if the page you are going to requires a lookup, you'll notice with the tabID it can extract the tabID from the URL.

What are the urls you have now for those pages?


Scott McCulloch
Site Administrator
ty aUser is Offline
Gold Membership
Nuke Active Member
Nuke Active Member
Posts:35


10/15/2005 8:05 PM  
an personal page is in this format http://www.otbradio.com/SubliminalThought/tabid/247/Default.aspx.

i'd like to give each user a url in the form of
http://www.otbradio.com/SubliminalThought/ which gets mapped to the above.

is this possible with rewrite rules?
Scott McCullochUser is Offline
Administrators
Nuke Master
Nuke Master
Posts:14659


10/16/2005 4:47 AM  
Posted By curlyfro on 15/10/2005 8:05:05 PM
an personal page is in this format http://www.otbradio.com/SubliminalThought/tabid/247/Default.aspx.

i'd like to give each user a url in the form of
http://www.otbradio.com/SubliminalThought/ which gets mapped to the above.

is this possible with rewrite rules?



It is possible, but requires some IIS changes. By default a request to a non-existant physical file like SubmliminalThought would get handled by default 404 handler from IIS and never enter the ASPNET process to be rewritten.

The first step is to make all requests go through the ASPNET process. This will incur a little extra processing on the web server's behalf as it will send images etc through the aspnet process. To map all requests to the aspnet process see this article here:-

http://www.dotnetdevs.com/articles/AttributeBasedURLDispatch.aspx

(the section is under "does it work for all urls" and will show you how to do this for Windows 2003)

Now that all requests go through the aspnet process we can rewrite that request if its in our rules.

Here were the rules I added for www.ventrian.com:-

<RewriterRule>

<LookFor>/</LookFor>

<SendTo>~/default.aspx</SendTo>

</RewriterRule>

<RewriterRule>

<LookFor>/Login</LookFor>

<SendTo>~/default.aspx?ctl=login</SendTo>

</RewriterRule>

<RewriterRule>

<LookFor>/Friendly</LookFor>

<SendTo>~/default.aspx?TabId=79</SendTo>

</RewriterRule>

You'll notice there is a default one there (/), this is because it never gets to the default.aspx file, this is only redirected when a file is not found (when not piping everything through the aspnet process)

So, the following URLs shoudl now work:-

http://www.ventrian.com/login

http://www.ventrian.com/friendly

One day soon, I'm going to build some screens so you could do this on a per portal basis and make things a bit easier.


Scott McCulloch
Site Administrator
ty aUser is Offline
Gold Membership
Nuke Active Member
Nuke Active Member
Posts:35


10/16/2005 7:06 AM  
very cool.

now, somehow, i need to convince my hosting provider to make the IIS changes 

thanks Scott
Scott McCullochUser is Offline
Administrators
Nuke Master
Nuke Master
Posts:14659


10/17/2005 4:14 PM  

There is also an issue using this method with child portals (www.domain.com/child) because it will check for that url instead of using the default.aspx as a default document. But if you don't use child portals you are OK.


Scott McCulloch
Site Administrator
You are not authorized to post a reply.
Forums > General > DotNetNuke Questions > URLSiteUrls Rule problem



ActiveForums 3.7