内部服务器错误.htaccess

问题描述:

I have a problem with my .htaccess file.

In my .htaccess file I have this:

RewriteEngine on

RewriteRule ^user/([0-9a-zA-Z]+) user.php?u=$1 [NC, L]

And it is placed in my C:/../wamp/www/mysite/

My site worked before I had this file, so I'm not sure what I'm doing wrong. I'm kind of new to this aswell so it's bound to go wrong. Whenever I run my site I get the error: Internal Server Error

"The server encountered an internal error or misconfiguration and was unable to complete your request."

我的 .htaccess code>文件有问题。 p> \ n

在我的 .htaccess code>文件中我有这个: p>

  RewriteEngine on 
 
RewriteRule ^ user /([0-9a-zA  -Z] +)user.php?u = $ 1 [NC,L] 
  code>  pre> 
 
 

它放在我的 C:/../ wamp中 / www / mysite / code> p>

我的网站在我有这个文件之前就已经工作了,所以我不确定我做错了什么。 我有点新鲜 这也是一定会出错。 当我运行我的网站时,我收到错误: 内部服务器错误 p>

“服务器遇到内部错误或配置错误,无法完成 请求。“ p> div>

You haven't finished the rule, change it to:

RewriteRule ^user/([0-9a-zA-Z]+)$ user.php?u=$1 [NC,L]
#-------------------------------^

Okay, now that it looks like you haven't enabled the rewrite engine. Check .htaccess: Invalid command 'RewriteEngine', perhaps misspelled or defined by a module not included in the server configuration for more information on how to enable it.

Update: If you are struggling with this, there's a Youtube video on how to do it: Youtube: How to enable rewrite module in WAMP Server?

Update: If you get Bad Flag Delimiters error, please don't give any spaces between the flags. For more information, see RewriteRule Error: Bad flag delimiters.