Y
Y
yurygolikov2017-02-15 21:55:08
Yii
yurygolikov, 2017-02-15 21:55:08

How to make default route in UrlManager with PrettyUrl in Yii2?

How to make default route in UrlManager with PrettyUrl in Yii2?
'defaultRoute' => 'site/index' - I understand it doesn't work in PrettyUrl.
Are there options other than this?
'<url:(.*)>' => 'site/index'

Answer the question

In order to leave comments, you need to log in

3 answer(s)
L
Lumore, 2017-02-15
@Lumore

'' => 'site/index'

A
Andrey, 2017-02-16
@reaferon

.htaccess is like this by default:

Options +FollowSymLinks
IndexIgnore */*

RewriteEngine on

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . index.php
AddDefaultCharset utf-8

Does everything match?

M
Maxim Fedorov, 2017-02-16
@qonand

'defaultRoute' => 'site/index' - I understand it doesn't work in PrettyUrl.
This is how the default route is set, if it does not work for you, then you have not configured something correctly (for example, htaccess).

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question