的.htaccess不工作 [英] .htaccess not working

查看:163
本文介绍了的.htaccess不工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经做了全新安装的XAMPP,安装含有下列的htaccess 的文件没有显示在浏览器中的文件夹后。

I have done a fresh installation of xampp , after installing the folder containing following htaccess file is not showing in my browser.

SetEnv APPLICATION_ENV development

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ index.php [NC,L]

它提供了500错误,并且服务器超载

it gives 500 error and the server is overloaded

这发生在我试图执行公共文件夹在我的Zend的应用程序。

This happens when I am trying to execute the public folder in my zend application.

请建议我是否必须做在我的XAMPP任何修改为得到我的的.htaccess 文件,以正确执行。

Please suggest to me whether I have to do any modifications in my xampp for getting my .htaccess file to execute correctly.

在此先感谢

推荐答案

1)确保你的Apache配置文件中启用的mod_rewrite

1) Make sure you've enabled mod_rewrite in the Apache configuration file.

2)添加行的AllowOverride全部在Apache的配置文件的目录结构。

2) Add the line AllowOverride All to the directory configuration in the Apache config file.

此外,除非你有很多重写,我提出以下建议对你目前的规则。

Additionally, unless you have a lot of rewrites, I recommend the following over your current rules.

SetEnv APPLICATION_ENV development

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-s
RewriteCond %{REQUEST_FILENAME} !-l
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^.*$ index.php [NC,L]

这篇关于的.htaccess不工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆