.htaccess mod_rewrite > 500 Internal Server Error

前端 未结 7 1267
梦毁少年i
梦毁少年i 2020-12-02 03:03

I am using .htaccess.

My original link is:

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

And I\'m trying to make it look lik

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

    Check your ../apache/conf/httpd.conf and look for:

    #LoadModule rewrite_module modules/mod_rewrite.so
    

    If the hash sign (#) appears as the first letter, remove it, save it and restart server.

    0 讨论(0)
  • 2020-12-02 03:36

    500 Errors are often the result of file permission errors rather than anything else. Check the permissions on your .htaccess file.

    The required permissions vary depending on the environment (I presume this is on Linux - shouldn't be a problem on Widows).

    0 讨论(0)
  • 2020-12-02 03:37

    That .htaccess doesn't belong in CareerDays. If you write a request to a directory off of the root, the server FIRST checks if the directory exists, if it doesn't it will then give precedence to the ROOT .htaccess. It won't think to check an .htaccess in an unrelated directory.

    0 讨论(0)
  • 2020-12-02 03:39

    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.

    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.

    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.

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

    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.

    [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.

    You must have AllowOverride set to 'All' or 'FileInfo' in httpd.conf file for having permissions of mod_rewrite directives in .htaccess file.

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

    0 讨论(0)
  • 2020-12-02 03:41

    On my hosting I needed add first line : RewriteBase / until then I get Internal server error too.

    0 讨论(0)
  • 2020-12-02 03:41

    Remove:

    Options +FollowSymLinks
    

    Then upload to the root folder in ASCII mode from your FTP client.

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