Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • stevejack 3 posts 73 karma points
    Jan 17, 2018 @ 10:59
    stevejack
    0

    URL web.config special symbol redirection

    I also have some queries about the web.config redirection

    i need to redirect

    www.abc.com.au/"

    to

    www.abc.com.au

  • Alex Skrypnyk 6150 posts 24110 karma points MVP 8x admin c-trib
    Jan 17, 2018 @ 12:14
    Alex Skrypnyk
    0

    Hi Steve

    Add this rewrite rule:

    <rule name="Remove trailing slash" stopProcessing="true">
    <match url="(.*)/$" />
    <conditions>
    <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
    <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
    </conditions>
    <action type="Redirect" redirectType="Permanent" url="{R:1}" />
    </rule>
    

    /Alex

  • Alex Skrypnyk 6150 posts 24110 karma points MVP 8x admin c-trib
    Jan 17, 2018 @ 12:28
    Alex Skrypnyk
    0

    Also, change this setting in UmbracoSettings.config:

      <requestHandler>
        <!-- this will add a trailing slash (/) to urls when in directory url mode -->
        <addTrailingSlash>false</addTrailingSlash>   
      </requestHandler>
    
  • stevejack 3 posts 73 karma points
    Jan 19, 2018 @ 04:14
    stevejack
    0

    Actually i need a particular rule for the (") Quote redirect to the root page

    Please suggest me the best solution. the above is not working.

  • Alex Skrypnyk 6150 posts 24110 karma points MVP 8x admin c-trib
    Jan 19, 2018 @ 09:06
    Alex Skrypnyk
    0

    Try this:

    <rule name="Remove trailing slash" stopProcessing="true">
    <match url="(.*)/"$" />
    <conditions>
    <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
    <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
    </conditions>
    <action type="Redirect" redirectType="Permanent" url="{R:1}" />
    </rule>
    
  • Sumesh KP 35 posts 108 karma points c-trib
    Jan 20, 2018 @ 18:47
    Sumesh KP
    0

    Hi Steve,

    Can You please try the following rule:

    <rule name="Redirect_all_URLs_with_quotes_to_homepage" stopProcessing="true">
          <match url="(.*)" />
          <conditions>
               <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
               <add input="{REQUEST_URI}" pattern="^/(.*)?(&quot;|')(\/)?$" />
          </conditions>
          <action type="Redirect" url="/" />
    </rule>
    

    Can you confirm that you have the double quotes or single quotes in the URL? Because When ever we use the double quotes in URL the browser will show Server Error in '/' Application. Illegal characters in path.

    But in the both cases the above rule you can use. :)

    { Sumesh KP }

Please Sign in or register to post replies

Write your reply to:

Draft