5
Vote

Trailing '/' for urls

description

I create a website and have the following:
http://mywebsite.azurewebsites.net/mypage/ - 404
http://mywebsite.azurewebsites.net/mypage - 200

I found on this website then you already fixed this issue twice, but the last release 1.7.2 still have it.
Could you please fix it.

Thanks

comments

BertrandLeRoy wrote Nov 24, 2013 at 11:51 PM

Did you read the resolution of those tow other bugs? The solution is to use IIS url rewrites.

AimOrchard wrote Nov 25, 2013 at 5:50 AM

'A' solution. Maybe a core fix would be nice here?

BertrandLeRoy wrote Nov 25, 2013 at 7:48 AM

It's been discussed and rejected before. If there are new arguments however, why not?

AimOrchard wrote Nov 25, 2013 at 8:24 AM

The fact that multiple people felt affected by it should count as an argument.

It doesn't annoy us personally that much (since we are aware of it so we 'remember' to not type in the forward slash) but for some the way it works now might come as a surprise.

So imho, a core fix needs to be done or people need to be educated how & why it is the way it is.

IE: make the bug a feature ;)

sebastienros wrote Nov 25, 2013 at 7:26 PM

http://www.asp.net/open-source/ permanently redirects you to http://www.asp.net/open-source
and this is not Orchard

AimOrchard wrote Nov 25, 2013 at 8:23 PM

yaplex wrote Nov 26, 2013 at 9:22 PM

I was able to use "workaround with IIS rewrite rule" on my website.
But "workarounds" do not make Orchard the best CMS

And I can't understand why do you ignore this issue, If it should be done using rewrite rule, just add it as part of your web.config file, because 404 is very bad behavior in this case

If somebody need IIS 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>

JasperD wrote Nov 27, 2013 at 2:13 AM

Two different URL's point to two different resources. If a resource does not exist, the server returns 404. Sounds right to me.

If anyone wants to make the server behave differently, it's a matter of server configuration and not application logic.

BertrandLeRoy wrote Dec 10, 2013 at 7:29 AM

Nobody's ignoring this: you got several responses for several of us...

The web.config redirects are not a workaround, they are the correct solution. If you don't want to modify web.config, you can install the rewrite rules module and do it from there.

BruceHodge wrote Dec 10, 2013 at 8:27 AM

You closed a ticket that I raised on this saying it's fixed and for me it's not.

The issue for me is not whether there is a closing tag, it's simply that when the resource is not found they get a blank page. That's not correct behaviour for a CMS, in a cms we should be able to re direct them to a page. If I've missed something in the config for that please add a note as I think it will address a number of concerns that people have.

I've tried some 404 modules and they don't work in the current release, so no solution there.

Whilst the problem exists you are going to put off people migrating sites to Orchard, since there is no out of the box way of dealing with urls that are no longer valid, such as ../Contact.php

yaplex wrote Dec 10, 2013 at 5:04 PM

I end up choosing different CMS system which don't have such issues.

sebastienros wrote Dec 10, 2013 at 6:19 PM

Let me file a bug on their system ;)

AimOrchard wrote Dec 10, 2013 at 6:38 PM

Is that really needed Sebastien? Really mature.

OT: Good luck on your future endeavours yaplex, thank you for your time trying out Orchard.

BertrandLeRoy wrote Dec 10, 2013 at 8:39 PM

I don't understand: custom 404 errors are handled out of the box.

morrisonbrett wrote Mar 18 at 8:08 PM

I like yaplex idea, that rule should be included in the default Orchard Web.Config

sebastienros wrote Mar 18 at 8:11 PM

** Closed by sebastienros 03/18/2014 1:11PM

sebastienros wrote Mar 18 at 8:16 PM

The agreement is to agree with this issue. The recommendation is to add a rewrite rule to the web.config by defining which one is the canonical url and make the other a permanent redirect to the canonical. Whichever you think is the canonical one.

You will have to ensure the IIS Rewrite module is installed though. For your convenience we will add a commented example in the web.config.