使用的.htaccess与RewriteEngine叙述时500内部服务器错误

编程入门 行业动态 更新时间:2024-10-22 20:31:20
本文介绍了使用的.htaccess与RewriteEngine叙述时500内部服务器错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我的共享主机 Bounceweb ,我想添加一些重写规则,使我的链接看起来prettier。

I am on the shared host Bounceweb and I am trying to add some rewrite rules to make my links look prettier.

这些规则之一是使网址: mysite/upload 指向:的http:// mysite的。 COM / upload.php的。我有这个在我的.htaccess文件:

One of these rules is to make the url: mysite/upload point to: mysite/upload.php. I have this in my .htaccess file:

RewriteEngine on RewriteRule ^upload$ upload.php

但所有它给了我一个500内部服务器错误。我看了看我的日志,这出现了很多:

but all it's giving me is a 500 Internal Server Error. I looked at my logs and this comes up a lot:

[alert] [client 81.179.29.185] /home/minecraf/public_html/.htaccess: Invalid command '\xef\xbb\xbfRewriteEngine', perhaps misspelled or defined by a module not included in the server configuration

这是否意味着我的主机不支持的.htaccess? pretty的跛脚,如果他们不这样做。我已经尝试过改变的.htaccess的权限为777,它并没有帮助。

Does this mean my host doesn't support .htaccess? Pretty lame if they don't. I've already tried changing the permissions of .htaccess to 777 and it doesn't help.

谢谢!

推荐答案

\ XEF \ XBB \ XBF 三种无形的垃圾字符(Apache的角度看,至少)称为统一code BOM或字节顺序标记。阿帕奇认为这些字符是正确的之后后面的命令的一部分。这是你的日志中看到,尽管这些字符转义所以他们看到肉眼。 \ XEF \ XBB \ xbfRewriteEngine

\xef\xbb\xbf are three invisible junk characters (at least from Apache's perspective) called the Unicode BOM, or byte order mark. Apache thinks that those characters are part of the command that follows right after. This is what you see in the log, though the characters are escaped so they're visible to the naked eye. \xef\xbb\xbfRewriteEngine

在编辑器中,特别是如果你的编辑器是记事本,请确保您保存您的文件没有BOM。这应该是选择在另存为对话框或其他地方。

In your editor, especially if your editor is Notepad, make sure you're saving your file without a BOM. This should be selectable in the save as dialog or elsewhere.

更多推荐

使用的.htaccess与RewriteEngine叙述时500内部服务器错误

本文发布于:2023-11-01 01:27:44,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1547847.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:错误   服务器   htaccess   RewriteEngine

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!