Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/.htaccess/5.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 wamp服务器500内部服务器错误_.htaccess_Mod Rewrite - Fatal编程技术网

.htaccess wamp服务器500内部服务器错误

.htaccess wamp服务器500内部服务器错误,.htaccess,mod-rewrite,.htaccess,Mod Rewrite,我为我的.htaccess RewirteEngine on RewriteCond %{REQUEST_FILENAME}!-d RewriteCond %{REQUEST_FILENAME}!-f RewriteRule^(.*)$index.php?url=$1[L,QSA] 当我写这段代码时,我的wamp服务器给了我一个错误500内部服务器错误 当我检查apache错误日志时,它给出了以下错误消息: C:/wamp64/www/testapp/.htaccess: RewriteC

我为我的
.htaccess

RewirteEngine on

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

RewriteRule^(.*)$index.php?url=$1[L,QSA]
当我写这段代码时,我的wamp服务器给了我一个错误500内部服务器错误

当我检查apache错误日志时,它给出了以下错误消息:

C:/wamp64/www/testapp/.htaccess: RewriteCond: bad argument line '%{REQUEST_FILENAME}!-d' C:/wamp64/www/testapp/.htaccess: RewriteCond: bad argument line '%{REQUEST_FILENAME}!-d'

请问这里有什么问题。需要回复

您的
.htaccess
代码片段中存在一些问题和打字错误

这是一个更正的版本

# was: RewirteEngine on
RewriteEngine on

# was: one line
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteCond %{REQUEST_FILENAME} !-f

# was: no spaces
RewriteRule ^(.*)$ index.php?url=$1 [L,QSA]

这里没有php/mysql,只有
.htaccess
指令。空格在Apache配置文件中用作分隔符。缺少许多空格/分隔符,因此参数正在合并为一个,这在语法上是无效的。