问题描述:添加根目录以外的其他路径无法访问,提示:
The requested URL /welcome was not found on this server.
经过搜索找到问题根源,和使用的本地集成开发环境有关,在一下网址找到解决办法,但具体原理不太清楚。
按照下面办法问题解决。
1、public目录下新建一个
public\.htaccess
2、填入下面内容
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews
</IfModule>
RewriteEngine On
# Redirect Trailing Slashes...
RewriteRule ^(.*)/$ /$1 [L,R=301]
# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
</IfModule>
3、重启本地集成开发环境。
https://stackoverflow.com/questions/40322399/the-requested-url-was-not-found-on-this-server