500 Internal Server Error when using .htaccess wit

2020-01-29 05:54发布

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

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

RewriteEngine on
RewriteRule ^upload$ upload.php

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

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.

Thanks!

7条回答
Bombasti
2楼-- · 2020-01-29 06:58

Just save your .htaccess file with UTF-8 encoding (without BOM) and upload. Recommended to use Notepad++. (in my case that helped).

atb

查看更多
登录 后发表回答