500 Internal Server Error when using .htaccess with RewriteEngine

后端 未结 7 830

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://mysit

相关标签:
7条回答
  • 2020-12-03 05:05

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

    atb

    0 讨论(0)
  • 2020-12-03 05:10

    To remove the BOM in unix use vi and below command

    : set nobomb

    : wq

    0 讨论(0)
  • 2020-12-03 05:11

    In some cases maybe mod_rewrite module in apache is not loaded . Check your apache configuration.

    Update:

    Windows xampp : Open xampp/apache/conf/httpd.conf and uncomment mod_rewrite module.
    Windows wamp : Open wamp/bin/apache/Apache2.x.x/conf/httpd.conf and uncomment mod_rewrite module.
    Ubuntu : Type in terminal : a2enmod rewrite
    Ubuntu manual : cp /etc/apache2/mods-available/rewrite.load /etc/apache2/mods-enabled/rewrite.load
    And then reload apache
    Ubuntu : service apache2 reload OR service apache2 restart
    Windows : From xampp or wamp control panel.

    0 讨论(0)
  • 2020-12-03 05:12
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    
    rewriterule ^upload$ upload.php
    
    </IfModule>
    

    try this.

    0 讨论(0)
  • 2020-12-03 05:15

    Try this:

    a2enmod rewrite    
    /etc/init.d/apache2 restart
    
    0 讨论(0)
  • 2020-12-03 05:26

    \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

    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.

    0 讨论(0)
提交回复
热议问题