1-888-365-2779
+1-888-365-2779
Try Now
More in this section

URL Rewrite

3 posts, 0 answered
  1. Pablo
    Pablo avatar
    2 posts
    Registered:
    04 Apr 2009
    19 Jan 2010
    Link to this post
    Hi, I want to achieve this using the url rewrite functionality:

     

    1 <rule> 
    2    <url>register\.domain\.com/(\w*)/(\w*)/page\.aspx</url> 
    3    <rewrite>domain.com/dir1/dir2/page.aspx?param1=register&amp;param2=$1&amp;param3=$2</rewrite> 
    4 </rule> 
    5  

    So when somebody enter on the browser: http://register.domain.com/fl/miami/default.aspx

     

    I don't want to redirect, but rewrite to:
    http://register.domain.com/app/register.aspx?p1=fl&p2=miami

    is that possible?

     

  2. Georgi
    Georgi avatar
    3583 posts
    Registered:
    28 Oct 2016
    21 Jan 2010
    Link to this post
    Hello Pablo,

    You will not be able to use the UrlRewriter in this case, since it's not working with domains and subdomains but rather from the application root.  Such rules can be:

    <rule>
       <url>/(\w*)/(\w*)/page\.aspx</url>
       <rewrite>/dir1/dir2/page.aspx?param1=register&param2=$1&param3=$2</rewrite>
    </rule>

    You can use the IIS7 UrlRewriter though, or 3rd party module. 

    I hope this helps.

    Greetings,
    Georgi
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  3. Pablo
    Pablo avatar
    2 posts
    Registered:
    04 Apr 2009
    24 Jan 2010
    Link to this post
    I ended up using a combination of Domain - page mapping and URL Rewriting to get what I wanted.

    first I created a domain - page rule:

    registration.domain.com -> domain.com/registration

    and the url rewrite rule:

    /(.*)/(.*)/(.*)\.aspx
    /$3.aspx?param1=$1&amp;param2=$2

    That worked for my requirements.

    Thanks for your help.
Register for webinar
3 posts, 0 answered