.htaccess mod_rewrite > 500 Internal Server Error

前端 未结 7 1387
梦毁少年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: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

提交回复
热议问题