My goal is write web app using Yii-2. I'm use apache as my local web server on ubuntu. Currently, I want to configure yii2 urlManager. And write this in config/web.php:
'urlManager' => [
'class' => 'yii\web\UrlManager',
'enablePrettyUrl' => true,
'showScriptName' => false,
],
This is simple setup. Where enablePrettyUrl work fine and i can use url-link such as http://localhost/basic/web/index.php/nameOfController/AndAction. But when i setup showScriptName this does not work correct for me. I configure apache as:
<Directory /var/www/>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
And to of course I added .htaccess file into web folder, with this:
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . index.php
I use basic yii2-basic application and after run server, I can open site for example as: localhost/basic/web/testController/testAction. But i want use link like this: localhost/basic/testController/testAction, at last example i dont use folder web.
Okay, thanks all who read it. And have you any idea how i can fix this? Thanks. And mod_rewrite is enabled too.