RewriteRule creating 500 Internal Server Error

后端 未结 4 2185
盖世英雄少女心
盖世英雄少女心 2020-12-07 01:03

I have the following in my .htaccess file:

Options +FollowSymLinks
RewriteEngine on
RewriteRule ^directory/(.*)$ directory/index.php?id=$1

4条回答
  •  离开以前
    2020-12-07 01:52

    You should try adding a forward slash to the front:

    RewriteRule ^/directory/(.*)$ directory/index.php?id=$1
    

    I've been caught out with that before.

    Alternatively use the RewriteLog and RewriteLogLevel to debug, and look at the Apache error and access logs for further info:

    RewriteLogLevel 3
    RewriteLog ${APACHE_LOG_DIR}/rewrite.log
    

    That will leave a log file in your apache log directory. In my case that is /var/log/apache

提交回复
热议问题