1
votes

We are using IIS 7.5(windows 7 and integrated mode) and SiteCore 6.4. I have installed IIS Url Rewrite Feature to rediect permenetly moved url. I have setup a Test folder inside website root for which we do not have any items on sitecore content tree. I have setup url redirect for this folder using URL Rewrite feature of iis 7. But for some reason when i browse the Test folder, it is taking me to sitecore 404 page. Ideally it should redirect the page.

Rewrite rule:

<rewrite>
    <rules>
        <rule name="Sitecore_local" stopProcessing="true">
            <match url="/TestUrlRedirect/" />
            <action type="Redirect" url="http://www.google.com" />
        </rule>
    </rules>
</rewrite>

I am trying to access http://localhost/TestUrlRedirect/

4
- Why create the physical folder? Are there any files in it? You can setup a redirect rule without a folder. - Sean Kearney
What does your rule look like? - Sean Kearney
I have created physical folder just for testing purpose. Even i delete it, it still give sitecore item not found page. I have added my redirect script in my quesion - Neil
Check that it's not another state that is using the 404 page. For example, 'no presentation'. Check web.config for the 404 path to see references. - Paul George

4 Answers

0
votes

(updated for actual testing url)

A working regex pattern, for the url you specified, would be configured via this rule.

Try this:

<rule name="Sitecore_local" stopProcessing="true">
    <match url="^TestUrlRedirect/(.*)" />
    <action type="Redirect" url="http://www.ascap.com" />
</rule>

Take a look at this for some starters. http://learn.iis.net/page.aspx/461/creating-rewrite-rules-for-the-url-rewrite-module/

You need to set the url to a regex pattern that matches what you want.

0
votes

Can you please try the line below?

<match url="TestUrlRedirect(.*)" />

0
votes

As we are using IIS 6.0 on sitecore CD server and IIS 7.5 on CM server, i resolve this issue by having my own url rewrite module.

0
votes

You could also try to include your URL in

  <!--  IGNORE URLS
        Set IgnoreUrlPrefixes to a '|' separated list of url prefixes that should not be 
        regarded and processed as friendly urls (ie. forms etc.)
  -->
  <setting name="IgnoreUrlPrefixes" value="..."/>

This will tell Sitecore to ignore your folder from processing.