apache's tag archives

用.htaccess设置禁止显示Apache目录列表

注意:使用此方法不当时,设置的.htaccess文件会引起403 Forbidden 禁止访问的问题 如何禁止 Apache 显示目录列表呢? 缺省情况下如果你在浏览器输入地址:http://localhost:8080/ 并且你将你的目录索引文件设置为 index.html,且你的文件根目录里有 index.html,浏览器就会显示 index.html的内容,如果没有 index.html,浏览器就会显示文件根目录的目录列表,目录列表包括文件根目录下的文件和子目录。(注:索引文件的设置:)#在这里,你可以设置某个目录被请求时,首先执行的文件 同样你输入一个虚拟目录的地址:http://localhost:8080/b/ 如果该虚拟目录下没有 index.html,浏览器也会显示该虚拟目录的目录结构,列出该虚拟目录下的文件和子目录。 如何禁止 Apache 显示目录列表呢? 在 httpd.conf文件里找到类似这样指令: 将指令作这样的修改: 方法一:在Options Indexes FollowSymLinks在Indexes前面加...

Create web server on Mac

Apache Start Apache Check it's working: http://localhost/ PHP In /etc/apache2/httpd.conf, uncomment this line: Restart Apache Fix a warning appearing in phpinfo() Create /etc/php.ini and make it writable In php.ini, find this line: Uncomment it and insert your time zone (http://php.net/manual/en/timezones.php) Restart Apache MySQL Download the MySQL package for Mac OS X.5 (32 or 64 bits depending on your machine) Install everything in...

Thinkphp htaccess rewrite的问题

我的网站Thinkphp配置URL_MODE为2, 传到服务器就出现这样的错误,无论进什么页面都会跳转到首页. htaccess文件的配置如下: 后来发现问题出现在Apache的版本上,好像不同版本对rewrite的解析不一样。 修改htaccess如下后,工作正常: