Php htaccess重写在LAMP服务器上不工作

Php htaccess重写在LAMP服务器上不工作,php,apache,.htaccess,mod-rewrite,lamp,Php,Apache,.htaccess,Mod Rewrite,Lamp,我最近在我的LAMP服务器(ubuntu)上安装了LAMP,从那以后我似乎遇到了配置问题。我安装了两个应用程序和一个应用程序,但存在重定向问题 我无法再使用localhost/my-app/访问我的Symfony2应用程序,我必须使用localhost/my-app/web/app\u-dev.php/运行不正常的应用程序 我的slim应用程序也不起作用。我想访问http://localhost/slimapp/admin/public/index.php使用地址:http://localhos

我最近在我的LAMP服务器(ubuntu)上安装了LAMP,从那以后我似乎遇到了配置问题。我安装了两个应用程序和一个应用程序,但存在重定向问题

我无法再使用
localhost/my-app/
访问我的Symfony2应用程序,我必须使用
localhost/my-app/web/app\u-dev.php/
运行不正常的应用程序

我的slim应用程序也不起作用。我想访问
http://localhost/slimapp/admin/public/index.php
使用地址:
http://localhost/slimapp/admin
我的路线设计为这样使用:

http://localhost/slimapp/admin/login
http://localhost/slimapp/admin/user
http://localhost/slimapp/admin/user/update
etc...
在我的管理员文件夹(我的slim应用程序:var/www/html/slimapp/admin/)中,我有一个.htaccess,如下所示:

# Allow any files or directories that exist to be displayed directly
RewriteCond ${REQUEST_URI} ^.+$
RewriteCond %{REQUEST_FILENAME} \.(gif|jpe?g|png|js|css|swf|php|ico|txt|pdf|xml)$ [OR]
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d [OR]
RewriteCond %{REQUEST_FILENAME} -l
RewriteRule ^ - [L]
<IfModule mod_rewrite.c>
    IndexIgnore *.zip *.jpg *.gif
    RewriteEngine on
    RewriteRule    ^$    public/index.php    [L]
    RewriteRule    (.*) public/index.php/$1    [L]
 </IfModule>
#允许直接显示现有的任何文件或目录
重写cond${REQUEST_URI}^+$
重写cond%{REQUEST_FILENAME}\(gif | jpe?g | png | js | css | swf | php | ico | txt | pdf | xml)$[或]
RewriteCond%{REQUEST_FILENAME}-f[或]
RewriteCond%{REQUEST_FILENAME}-d[或]
RewriteCond%{REQUEST_FILENAME}-l
重写规则^-[L]
IndexIgnore*.zip*.jpg*.gif
重新启动发动机
重写规则^$public/index.php[L]
重写规则(.*)public/index.php/$1[L]
我的htaccess是错误的还是配置问题

如果是配置问题,如何识别问题


谢谢

如果您使用的是symphony2,是否参考了symphony2 htaccess文件?问题是,在安装phpbrew之前,它工作得很好。我尝试了这个htaccess文件,但它也不工作。对于您发送给我的文件,我的项目中所有文件/文件夹的列表都显示在浏览器中。我有一个错误,当访问localhost/mysymfony2project/如果您使用的是symphony2,那么我有一个404错误。您是否参考了symphony2 htaccess文件?问题是,在安装phpbrew之前,它工作得很好。我尝试了这个htaccess文件,但它也不工作。对于您发送给我的文件,我的项目中所有文件/文件夹的列表都显示在浏览器中。有一次,我在访问localhost/mysymfony2项目时出现了404错误/