Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[UrlManager ] Urls with trailing slashes #6498

Closed
twisted1919 opened this issue Dec 12, 2014 · 1 comment
Closed

[UrlManager ] Urls with trailing slashes #6498

twisted1919 opened this issue Dec 12, 2014 · 1 comment

Comments

@twisted1919
Copy link

Hi,

The way url manager handles urls with a trailing slash is a bit wrong.

If i use a configuration like:

'urlManager' => [
            'class'           => 'yii\web\UrlManager',
            'enablePrettyUrl' => true,
            'showScriptName'  => false,
            'suffix'          => null, 
            'rules'           => [...],
        ],

And i access any of generated urls that look like:

http://domain.com/yii-basic/abc/48880/some-slug 

everything works, but when adding the trailing slash

http://domain.com/yii-basic/abc/48880/some-slug/

it goes to 404.

Now i understand that maybe yii is treating this as a suffix, but is wrong.
Urls with or without trailing slashes must be both loaded.

If i don't use trailing slashes and my site is by any reason accessed with trailing slashes (links back from various sources, i.e: wordpress) then i can't load any page.
If on the other hand i use trailing slash as a suffix then any incoming link without a trailing slash goes to trash, this is weird behavior which needs fix :)

Thanks.

@qiangxue
Copy link
Member

Please see this discussion: #1807

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants