路由错误或 wamp 错误?
Posted
技术标签:
【中文标题】路由错误或 wamp 错误?【英文标题】:Wrong routing or wamp error ? 【发布时间】:2018-06-02 05:02:40 【问题描述】:我刚刚开始了一个新的 symfony 项目,但我的 wamp 出了点问题,我不知道这是来自 Wamp、vhost 还是 Symfony。
我希望你能帮助我。
当我想测试我的虚拟主机时,使用 url kingdom/
我收到此错误 403:
您无权访问此服务器上的 /。 Apache/2.4.23 (Win32) php/5.6.25 服务器在王国端口 80
我的 hhtpd-vhost.com 包含
# Virtual Hosts
#
<VirtualHost *:80>
ServerName localhost
ServerAlias localhost
DocumentRoot c:/wamp/www
<Directory "c:/wamp/www/">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require local
</Directory>
</VirtualHost>
<VirtualHost *:80>
ServerName kingdom
ServerAlias kingdom
DocumentRoot c:/wamp/www/Kingdom
<Directory "c:/wamp/www/Kingdom/">
Options -Indexes
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
#
在我的主机文件中,我得到了这个
# Copyright (c) 1993-2009 Microsoft Corp.
#
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
#
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
#
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a '#' symbol.
#
# For example:
#
# 102.54.94.97 rhino.acme.com # source server
# 38.25.63.10 x.acme.com # x client host
# localhost name resolution is handled within DNS itself.
# 127.0.0.1 localhost
# ::1 localhost
127.0.0.1 kingdom
#
现在,在我的 app/config/routing.yml 上
user:
resource: "@UserBundle/Resources/config/routing.yml"
prefix: /user
wos_way_of_shogun:
resource: "@WOSWayOfShogunBundle/Resources/config/routing.yml"
prefix: /
在我的 WOSWayOfShogunBundle/config/routing.yml
wos_way_of_shogun_homepage:
path: /
defaults:
_controller: WOSWayOfShogunBundle:Default:index
wos_way_of_shogun_homepage_bis:
path: /accueil
defaults:
_controller: WOSWayOfShogunBundle:Default:index
无论哪种方式,我仍然收到 kingdom/
的 403 错误和 kingdom/app_dev.php/accueil
的 404 错误
感谢您的帮助,如果您能看到我在这里缺少的东西...一定很简单但是:(
【问题讨论】:
【参考方案1】:将 c:/wamp/www/Kingdom 更改为 c:/wamp/www/Kingdom/web
# Virtual Hosts
#
<VirtualHost *:80>
ServerName localhost
ServerAlias localhost
DocumentRoot c:/wamp/www
<Directory "c:/wamp/www/">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require local
</Directory>
</VirtualHost>
<VirtualHost *:80>
ServerName kingdom
ServerAlias kingdom
DocumentRoot c:/wamp/www/Kingdom/web
<Directory "c:/wamp/www/Kingdom/web">
Options -Indexes
Order allow,deny
Allow from all
AllowOverride All
</Directory>
</VirtualHost>
#
【讨论】:
非常感谢,这让我快疯了 ^^但是 app_dev 在网络中是有道理的......我应该能够自己弄清楚 :( 我是太糟糕了^^还是谢谢。以上是关于路由错误或 wamp 错误?的主要内容,如果未能解决你的问题,请参考以下文章
由于构建或路由导致 Play Framework 2.4 编译错误
Laravel - 当 API 路由错误或找不到时如何显示 JSON?