关于httpd.conf
我开始学习 symfony for php 框架,但我遇到了 httpd.conf 配置问题。
首先,我在 Windows c:\xampplite\ 上安装了 xampplite
,然后创建了一个 symfony 项目(如入门指南中所述) c:\xampplite\htdocs\symfonytest\
当我尝试访问 http://localhost/symfonytest/web/ 时一切正常 (所有图标和文本都显示得很好)
现在我必须配置 httpd.conf,然后输入如下:
<VirtualHost 127.0.0.1/symfonytest>
DocumentRoot "c:\xampplite\htdocs\symfonytest\web"
DirectoryIndex index.php
<Directory "c:\xampplite\htdocs\symfonytest\web">
AllowOverride All
Allow from All
</Directory>
Alias /sf c:\xampplite\htdocs\symfonytest\web\sf
<Directory "c:\xampplite\htdocs\symfonytest\web\sf">
AllowOverride All
Allow from All
</Directory>
但它根本没有效果......当我输入 http://127.0.0.1/symfonytest/它仍然显示我的 c:\xampplite\htdocs\symfonytest\ 的目录列表
如何解决这个 httpd.conf 问题?
谢谢 !!!
I'm starting to learn symfony for php framework and I got problem with httpd.conf configuration.
First, I have xampplite installed on my windows c:\xampplite\
and then I created a symfony project (as described on getting started guide)
c:\xampplite\htdocs\symfonytest\
Everything works fine when I tried to access http://localhost/symfonytest/web/
(all icons and text are displayed pretty well)
Now I got to configure the httpd.conf and I type like this:
<VirtualHost 127.0.0.1/symfonytest>
DocumentRoot "c:\xampplite\htdocs\symfonytest\web"
DirectoryIndex index.php
<Directory "c:\xampplite\htdocs\symfonytest\web">
AllowOverride All
Allow from All
</Directory>
Alias /sf c:\xampplite\htdocs\symfonytest\web\sf
<Directory "c:\xampplite\htdocs\symfonytest\web\sf">
AllowOverride All
Allow from All
</Directory>
But it has no effect at all ... when I type http://127.0.0.1/symfonytest/ it still displayed directory list of my c:\xampplite\htdocs\symfonytest\
How to solve this httpd.conf problem?
Thank you !!!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您无法使用 VirtualHost 来做到这一点。相反,使用别名:
这应该按照您的预期工作。
You can't do that using a VirtualHost. Instead, use an Alias:
This should work as you're expecting it to.