Yii2 + htaccess + wamp给出404 Not Found

时间:2016-02-08 08:47:20

标签: .htaccess yii2 wamp virtualhost

请帮助,我已经阅读了很多有关此问题的帖子,没有任何帮助。

我在y:2下安装:c:/ sites / mysite

index.php文件位于:c:/ sites / mysite / web

我在c:/ sites / mysite下有htaccess文件,如下所示:     #打开重写引擎     

上的RewriteEngine

RewriteBase / RewriteRule ^ index.html?$ home.php [NC,R,L] DirectoryIndex home.php

# on what should it skip the rules
RewriteRule ^(favicon.ico) - [L]

# if a directory or a file exists, use it directly
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

# Do not allow calls from servers testing ou server fi were a proxy
#  http://serverfault.com/questions/499125/banning-all-azenv-php-request-to-my-server
#RewriteCond %{HTTP_REFERER} .*/azenv\.php [NC,OR]
#RewriteRule .* - [F]

#RewriteCond %{HTTP:X-Forwarded-Proto} !https
#RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI}

# otherwise forward it to index.php
RewriteRule . index.php

我的my-vhosts文件包含以下代码:     ServerName armanager     ServerAlias armanager     DocumentRoot" c:/ sites / armanager / web"          选项索引FollowSymLinks         选项索引FollowSymLinks         AllowOverride all         要求全部授予     

在firefox上使用mysite可以正常工作。

我有一个带有actionSettings功能的控制器esController。 我有一个视图settings.php

转到mysite / es / settings会给我带来可怕的404 Not Found错误。

你能帮忙吗?

1 个答案:

答案 0 :(得分:0)

好的,我在网络文件夹中添加了 .htaccess

<IfModule mod_rewrite.c>
  RewriteEngine on

  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d

  RewriteRule . index.php
</IfModule>

现在,一切正常。

相关问题