的.htaccess不会对XAMPP工作(视窗7) [英] .htaccess doesn't work on xampp (windows 7)

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

问题描述

我设置我的的.htaccess 文件,现在使用的友好的URL (手动)。但是,当我去到URL服务器显示我的错误404

I'm setting my .htaccess file right now to use friendly urls (manually). But, when i go to the url the server shows me Error 404.

RewriteEngine on

RewriteCond %{SCRIPT_FILENAME} !-d  
RewriteCond %{SCRIPT_FILENAME} !-f  

Rewriterule ^register$ register.php 

我真的相信的mod_rewrite 启用,因为我看到它时,使用的phpinfo()

I'm really sure that mod_rewrite is enabled because i see it when use phpinfo().

推荐答案

尽管mod-rewrite已启用,默认情况下它是不启用的.htaccess 文件。

Even though mod-rewrite is enabled, by default it is not enabled for .htaccess files.

屏住呼吸

  • 开启XAMPP控制面板
  • 停止阿帕奇
  • 单击上安装的Apache行配置按钮,然后选择的httpd.conf
  • 在该文件中,搜索像 XAMPP的/ htdocs中>
  • 低一点,你可能会看到这样一行:#设置AllowOverride全部。删除,这是一条评论
  • 另外,搜索的AllowOverride全部,确保它在正确的部分,删除注释
  • 保存文件
  • 重启Apache,说祈祷,用你的手指,屏住呼吸
  • Open xampp control panel
  • Stop Apache
  • Click the Config button on the Apache row, and select httpd.conf
  • In that file, search for something like xampp/htdocs">
  • A bit lower, you may see a line like this: # AllowOverride All. Remove the #, which is a comment
  • Alternately, search for AllowOverride All, make sure it is in the right section, and remove the comment #
  • Save the file
  • Restart Apache, say a prayer, cross your fingers and hold your breath

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

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