I started learning yii2 and I tried to make some pretty pretty url stuff but couldn't. What I've done: -
in config / web.php (I edited below):
'urlManager' => [
'class' => 'yii\web\UrlManager',
'showScriptName' => false,
'enablePrettyUrl' => true,
'rules' => [
],
, then I created the file .htaccessand put it in root (it has the code below):
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . index.php
I also opened the apache2.conf file and was modified as follows:
<Directory /var/www/>
Options Indexes FollowSymLinks
AllowOverride All <! -- instead of none -->
Require all granted
</Directory>
I also checked the changes with the command:
grep -R AllowOverride /etc/apache2
And it looks like this:
/etc/apache2/apache2.conf: AllowOverride All
Now:
when I access my page via:
http: // localhost / yii2 / web /
it opens, and when I find the "About Link" link, it shows me: http: // localhost / yii2 / web / site / about (which shows that a nice handful)
But this URL does not work (says 404)
I tried the following posts for each code:
How to access controller with beautiful url in Yii2
URL- Yii2