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

Forums / General Discussions / Allow multiple URLs for this page

Allow multiple URLs for this page

9 posts, 0 answered
  1. Pierre Alain
    Pierre Alain avatar
    38 posts
    Registered:
    10 Jun 2008
    12 Aug 2011
    Link to this post
    We're porting an old site using Sitefinity, so we use the Allow multiple URLs for this page properies to redirect old pages to new one.
    That works well, except for pages with query string, such as ~/home.aspx?lang=fr

    In our old site we use query string to handle multiple language, so we'd like to set ~/home.aspx to redirect to ~/home (that works) and ~/home.aspx?lang=fr to redirect to ~/fr/accueil. That last part doesn't work. When setting that url in the property box, we get: One or more of the specified additional URLs are invalid.

    Is there any way to make this work?
  2. Svetoslav Petsov
    Svetoslav Petsov avatar
    456 posts
    Registered:
    24 Sep 2012
    15 Aug 2011
    Link to this post
    Hello Pacarrier,

    The current implementation of pages does not allow you to enter query string directly in the url of a page and we do not have an option for additional url. This is something that we are going to discuss and see how could be implemented. The simplest way to append some query string to the url is using another user control with a single public property where you can set the QueryString on page. The control will add the QueryString with Response.Redirect to the page inside Load event. I agree that this is not a good solution, because there will be always two requests to the page, but this is the simplest way to achieve your goal.

    All the best,
    Svetoslav Petsov
    the Telerik team
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. Susan
    Susan avatar
    14 posts
    Registered:
    08 Oct 2007
    01 Mar 2012
    Link to this post
    I know this is an old thread, but has there been any update on this functionality? Has it been added to a later release, or is there a better way to accomplish this? Thank you.
  4. Svetoslav Petsov
    Svetoslav Petsov avatar
    456 posts
    Registered:
    24 Sep 2012
    05 Mar 2012
    Link to this post
    Hello Steve,

     For now, this behaviour is not planned to be changed. One way to implement this would be like I described in my post. However, for your specific case, there might be a better approach for this (for example a URL rewriter or something similar).

    Greetings,
    Svetoslav Petsov
    the Telerik team
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  5. Huzaifa
    Huzaifa avatar
    4 posts
    Registered:
    18 May 2011
    23 May 2012
    Link to this post
    Hello, 
    I have very similar issues to that described in this post. I want to do a 301 redirect for URLs like this one for example :- www.mysitefinitysite.com/directions.html, so that it redirects to different page. I am using Allow Multiple URLs option on Page Properties to accomplish this in Sitefinity. But I am getting an error. Please see attached. Also I am not using query string parameters here either. 

    The images from the the following blog post by Gabe Sumner indicate that I should be able to do this
    http://www.sitefinity.com/blogs/gabesumner/posts/11-04-18/sitefinity_4_1_released_here_is_what_you_rsquo_ll_find.aspx 

    Why can I not do this? 
  6. Susan
    Susan avatar
    14 posts
    Registered:
    08 Oct 2007
    23 May 2012
    Link to this post
    Huzaifa,

    For what it's worth, it's still a bug and I've seen no news that there's a plan to address it. However, all is not totally lost, as our team came up with a workaround for the issue. It's admittedly completely hacky, but it's allowed us to handle the issue.

    The workaround uses "Allow Multiple URLs" in combination with the URL Rewrite module of IIS7. Basically, you create a rewrite rule that removes the html or aspx extension from the page you want to use as an additional URL and does a redirect to the new page. So, in your case, you would write a rule that redirects everything coming in as /<document>.html to just /<document> (It would create /directions.html to /directions in your example). Then, you add the ~/directions to the multiple URL field on the page in Sitefinity. So IIS redirects the traffic to an extensionless page that Sitefinity handles, and then Sitefinity handles the multiple URL mapping to the page you actually want to display.

    Like I said, it's a complete hack and adds an extra level of redirect that simply should not be necessary - this is basic functionality that should have been available from day 1 without any weak workarounds. But, given the scenario, its the only solution that we could come up with to solve the problem.

    Please let me know if this makes sense or if you need any clarification.
  7. Huzaifa
    Huzaifa avatar
    4 posts
    Registered:
    18 May 2011
    23 May 2012
    Link to this post
    Hi Steve,

    Thanks for replying. Your hack seems like what I am exactly looking for. I tried creating the rules but I think I am crafting it incorrectly...For instance I am following the guidelines as described here,

    http://stackoverflow.com/questions/10210936/url-rewrite-remove-html-extension 

    but it does not seem to work.  Can you possibly provide a working example of the rewrite XML specific to my case.


  8. Susan
    Susan avatar
    14 posts
    Registered:
    08 Oct 2007
    23 May 2012
    Link to this post
    Here's the rule that we use:
    <rule name="Remove ASPX" enabled="true" stopProcessing="true">
       <match url="(.*)\.aspx" />
       <action type="Redirect" url="{R:1}" />
    </rule>
    In your case, it should be easy enough to change that second line from .aspx to .html, although I haven't tested it for that scenario. Let me know if this works or if you still have issues.
  9. Huzaifa
    Huzaifa avatar
    4 posts
    Registered:
    18 May 2011
    23 May 2012
    Link to this post
    Thanks Steve
9 posts, 0 answered