htaccess的mod_rewrite的> 500内部服务器错误 [英] .htaccess mod_rewrite > 500 Internal Server Error

查看:213
本文介绍了htaccess的mod_rewrite的> 500内部服务器错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是用新的.htaccess,所以这可能是一个伪问题:。)

I am new with .htaccess, so this might be a dummy question :).

我原来的链接是:

http://example.com/CareerDays/index.php?u_type=admin

和我想使它看起来是这样的:

And I'm trying to make it look like this:

http://example.com/v/admin

整个code是这样的:

The entire code looks like this:

RewriteEngine On
RewriteRule ^v/([^/]*)$ /CareerDays/index.php?u_type=$1 [L]

和我总是得到 500内部服务器错误

有什么建议?

推荐答案

当你把一个.htaccess文件配置指令,而你没有得到预期的效果,也有一些事情,可能是想错了。

When you put configuration directives in a .htaccess file, and you don't get the desired effect, there are a number of things that may be going wrong.

最常见的问题是,设置AllowOverride 指令在httpd.conf文件未设置,使得您的配置指令的荣幸。请确保你没有在有问题的文件范围效果的AllowOverride无。一个很好的测试方法是把垃圾.htaccess文件并重新加载页面。如果没有生成服务器错误,那么你几乎可以肯定有效果的AllowOverride无。

Most commonly, the problem is that AllowOverride directive in httpd.conf file is not set such that your configuration directives are being honored. Make sure that you don't have a AllowOverride None in effect for the file scope in question. A good test for this is to put garbage in your .htaccess file and reload the page. If a server error is not generated, then you almost certainly have AllowOverride None in effect.

如果,在另一方面,您试图访问文件,检查你的httpd的错误日志,当越来越服务器错误。它可能会告诉你,是不允许在你的.htaccess文件中使用的指令。

If, on the other hand, you are getting server errors when trying to access documents, check your httpd error log. It will likely tell you that the directive used in your .htaccess file is not permitted.

[星期五09月17日十八时43分16秒2010] [警惕] [客户192.168.200.51]   /var/www/html/.htaccess:的DirectoryIndex此处不允许

[Fri Sep 17 18:43:16 2010] [alert] [client 192.168.200.51] /var/www/html/.htaccess: DirectoryIndex not allowed here

这将表明要么你已经使用了从未在.htaccess文件允许的指令,或者,你根本就没有设置AllowOverride设置为一个级别够你使用过的指令。查阅文档的特定指令,以确定是哪种情况。

This will indicate either that you've used a directive that is never permitted in .htaccess files, or that you simply don't have AllowOverride set to a level sufficient for the directive you've used. Consult the documentation for that particular directive to determine which is the case.

另外,它可能会告诉你,你在你的指令本身的使用有一个语法错误。

Alternately, it may tell you that you had a syntax error in your usage of the directive itself.

[星期六09年8月16点22分34秒2008] [警惕] [客户192.168.200.51]   /var/www/html/.htaccess:RewriteCond指令:糟糕的标志符

[Sat Aug 09 16:22:34 2008] [alert] [client 192.168.200.51] /var/www/html/.htaccess: RewriteCond: bad flag delimiters

在这种情况下,该错误信息应具体到您所提交的特定语法错误。

In this case, the error message should be specific to the particular syntax error that you have committed.

您必须设置AllowOverride设置为所有或FileInfo的在httpd.conf文件具有.htaccess文件的mod_rewrite指令的权限。

http://httpd.apache.org/docs/2.2/howto/ htaccess.html

这篇关于htaccess的mod_rewrite的> 500内部服务器错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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