Posts Tagged with enablePrettyUrl

Displaying 1-2 of 2 results.
Resolved: Yii2 showScriptName remove index.php Not Found apache
posted by admin on June 2, 2017
I tried to remove index.php from url by many ways, but without results.
My OS is Ubuntu Linux.
Server Apache.
In web.php in config directory

<?php
$config = [
'components' => [
'urlManager' => [
'class' => 'yii\web\UrlManager',
'enablePrettyUrl' => true,
'showScriptName' => false,
'rules' => [
'/' => 'site/index',
'login' => 'site/login',
'<controller:\w+>/<id:\d+>' => '<controller>/view',
'<controller:\w+>/<action:\w+>/<id:\d+>' => '<controller>/<action>',
'<controller:\w+>/<action:\w+>' => '<controller>/<action>',
],
],
]
]

Still not working
I try to created .htaccess in web direcory

RewriteEngine on
# If a directory or a file exists, use it directly
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# Otherwise forward it to index.php
RewriteRule . index.php

Still without result
In result
404 Not Found

Not Found

The requested URL /login was not found on this server.

Apache/2.4.18 (Ubuntu) Server at tracker.dev Port 80

Please help me to resolve problemRead more
Resolved: Yii2 slash 2f url problem
posted by admin on February 6, 2017
After installation Yii2, I try to navigate with pages of application, and in url I have problem with slashes

http://website.dev/index.php?r=site%2Fabout
http://website.dev/index.php?r=site%2Fcontact
http://website.dev/index.php?r=site%2Floginite%2Floginite%2Flogin

I want to slashes in url in place of %2FRead more