I am working on a Yii2 Project and have set it up on Wamp Localhost. My Wamp I have set up an alias:
Alias /project "c:/Users/Shaun/Desktop/projects/project/web/"
<Directory "c:/Users/Shaun/Desktop/projects/project/web/">
AllowOverride all
</Directory>
In a basic app I have placed the htaccess file into the web directory (where it is currently pointing to)
project/web/.htaccess
project/web/index.php
project/web/index-test.php
mod_rewrite is definitely enabled I have checked. I can navigate to my root without a problem:
This is my htaccess file as demonstrated on Yii2 docs.
RewriteEngine on
# If a directory or a file exists, use the request directly
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# Otherwise forward the request to index.php
RewriteRule . index.php
http://localhost/project/
When I navigate to url above I hit my SiteController Index action fine. But when I try to go to for example:
http://localhost/project/site/index
It states:
The requested URL /Users/Shaun/Desktop/projects/project/web/index.php was not found on this server.
But it is definitely there?! If you see my web.php configuration as a component I have enabled:
'urlManager' => [
'enablePrettyUrl' => true,
'showScriptName' => false,
]
Still can't find it. But if I do this it shows the routes fine:
http://localhost/project/index.php/site/index
So frustrating as I don't want this. What's the deal here?
Thanks,