Mod rewrite 如何将htaccess更改为访问symfony web目录

Mod rewrite 如何将htaccess更改为访问symfony web目录,mod-rewrite,symfony,Mod Rewrite,Symfony,我正在Windows7和Xampp中运行symfony2: http://localhost/symfony/web/app_dev.php/hello/symfony 如何使用下面的链接将web/.htaccess文件更改为访问symfony http://localhost/app_dev.php/hello/symfony 默认的.htaccess是: RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*

我正在Windows7和Xampp中运行symfony2:

http://localhost/symfony/web/app_dev.php/hello/symfony

如何使用下面的链接将web/.htaccess文件更改为访问symfony

http://localhost/app_dev.php/hello/symfony

默认的.htaccess是:

RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ app.php [QSA,L] 在使用反向代理的Nginx中也可以这样做吗?如何更改为不使用symfony/web的访问?

尝试添加127.0.0.1 www.mysymfony.com.localhost 进入etc/主机 将以下内容添加到httpd.conf中

# Be sure to only have this line once in your configuration<br>
NameVirtualHost 127.0.0.1:80

# This is the configuration for your project
Listen 127.0.0.1:80

<VirtualHost 127.0.0.1:80>
  ServerName www.mysymfony.com.localhost
  DocumentRoot "D:\xampp\htdocs\symfony\web"
  DirectoryIndex app.php
  <Directory "D:\xampp\htdocs\symfony\web">
    AllowOverride All
    Allow from All
  </Directory>
</VirtualHost>
访问此链接
它给出了一个错误,没有这个链接

这几乎没有研究成果。必须有这方面的教程/文档。-1。没有研究工作。很抱歉欢迎来到stackowerflow@奥洛夫·埃德勒:我是htaccess的新手,我在某处查阅了教程,但不知道htaccess是如何使用的works@m2mdas实际上它不工作,我重新启动了apache,甚至系统,它说没有收到数据,无法加载网页,因为服务器没有发送数据。以下是一些建议:稍后重新加载此网页。错误324 net::ERR\u EMPTY\u响应:服务器关闭了连接,但未发送任何数据。@m2mdas在更改httpd.conf和etc/hosts后,旧链接仍然有效。请从.htaccess删除重写基线,然后重试。另外,在httpd.conf中,我想服务器名应该是www.mysymfony.com.localhost。
# Be sure to only have this line once in your configuration<br>
NameVirtualHost 127.0.0.1:80

# This is the configuration for your project
Listen 127.0.0.1:80

<VirtualHost 127.0.0.1:80>
  ServerName www.mysymfony.com.localhost
  DocumentRoot "D:\xampp\htdocs\symfony\web"
  DirectoryIndex app.php
  <Directory "D:\xampp\htdocs\symfony\web">
    AllowOverride All
    Allow from All
  </Directory>
</VirtualHost>