Canvas
Canvas

Reputation: 5897

Orchard block content route

I have myself an orchard project, I uploaded a few files which will be used on the site, however some of these images lets say I don't want to display yet and I don't want to delete them because someone else may want to use them.

However if a view goes to the site for example

www.mywebsite.com/Contents/Item/Display/1

and attempts to find a random content item they will, which maybe provide or not used any longer. Basically what I'm trying to ask is inside of my Routes.cs in my Orchard project what would I need to implemented to redirect all users from content back to the home page?

Upvotes: 0

Views: 56

Answers (1)

Canvas
Canvas

Reputation: 5897

I have an answer that works for me.

I editted the web.config in the Orchard.Web project, I just added these lines inside of the system.webServer

<system.webServer>

...
...

  <rewrite>
    <rules>
      <rule name="Redirect users away from content" stopProcessing="true">
        <match url="^contents/(.*)" />
        <action type="Redirect" url="/" />
      </rule>
    </rules>
  </rewrite>

</system.webServer>

Hope this helps anyone else out.

Upvotes: 1

Related Questions