M
M
Michael2020-02-28 12:28:38
Yii
Michael, 2020-02-28 12:28:38

Why are there no links?

Hello everyone! Please tell me what could be the problem, when you try to go to another page, for example registration, it gives a 404 Not Found error, the same error if you write site/registration. urlManager is uncommented, there is htaccess in the root of the site. I work on Debian OS, LAMP is configured.
apache configuration setup

<VirtualHost *:80>
ServerName shk
ServerAlias www.shk

DocumentRoot "/var/www/shk/web"

ErrorLog "/var/www/shk/logs/error.log"
CustomLog "/var/www/shk/logs/access.log" common
</VirtualHost>

urlManager
'urlManager' => [
    'enablePrettyUrl' => true,
    'showScriptName' => false,
    'rules' => [
        'registration' => 'site/reglog',
    ],
],

htaccess
Options +FollowSymLinks
IndexIgnore */*
RewriteEngine on

RewriteCond %{REQUEST_URI} !^/(web)
RewriteRule ^assets/(.*)$ /web/assets/$1 [L]
RewriteRule ^css/(.*)$ web/css/$1 [L]
RewriteRule ^fonts/(.*)$ web/fonts/$1 [L]
RewriteRule ^js/(.*)$ web/js/$1 [L]
RewriteRule ^img/(.*)$ web/img/$1 [L]
RewriteRule (.*) /web/$1

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /web/index.php

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim, 2020-02-28
@Bally

Wrong htaccess or Apache setup. Remove the web there or there.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question