Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/.htaccess/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
将重写规则添加到.htaccess会导致服务器错误_.htaccess_Mod Rewrite_Wamp_Internal Server Error - Fatal编程技术网

将重写规则添加到.htaccess会导致服务器错误

将重写规则添加到.htaccess会导致服务器错误,.htaccess,mod-rewrite,wamp,internal-server-error,.htaccess,Mod Rewrite,Wamp,Internal Server Error,我已将以下行添加到.htaccess文件中: 它给了我index.php。这是一个使用Apache2.2.11win-PHP5.3.0的WAMP安装。如果要使用重写规则,需要启用。如何做到这一点取决于您使用的Apache安装。Wamp允许您通过配置菜单执行此操作。查看error.log文件以查看错误是什么。您写入${htp_COOKIE},这是故意的吗?@pekka:error log说:.htaccess:Invalid command'RewriteEngine',@jan:thank-修复

我已将以下行添加到.htaccess文件中:


它给了我index.php。这是一个使用Apache2.2.11win-PHP5.3.0的WAMP安装。

如果要使用重写规则,需要启用。如何做到这一点取决于您使用的Apache安装。Wamp允许您通过配置菜单执行此操作。

查看error.log文件以查看错误是什么。您写入${htp_COOKIE},这是故意的吗?@pekka:error log说:.htaccess:Invalid command'RewriteEngine',@jan:thank-修复了此错误,但错误仍然存在@tnt:您的Apache配置中是否启用了mod_rewrite模块?谢谢Jan,该模块已安装并启用。然而,我的.htaccess似乎没有效果。
Options +FollowSymlinks
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !^(.+)\.css$ [NC]
RewriteRule ^http://127.0.0.1(.*)$ http://127.0.0.1/getcss.php?$1/$2 [L,NC]
RewriteCond %{HTTP_COOKIE} ^.*site-cookie=([^;]+)$ [NC]
RewriteRule ^http://127.0.0.1(.*)$ http://127.0.0.1/cloked.php?$1/$2 [L,NC]
RewriteCond %{http_COOKIE} ^.*site-cookie=!([^;]+) [NC]
RewriteRule ^(.*)$ htp://127.0.0.1/noaccess.php?$1 [NC]