Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revision Both sides next revision | ||
litespeed_wiki:config:understanding_500 [2018/07/18 15:23] Lisa Clarke [Example 1] |
litespeed_wiki:config:understanding_500 [2018/09/12 19:43] Jackson Zhang [Different level of Rewrite rules misplaced to the wrong level] |
||
---|---|---|---|
Line 55: | Line 55: | ||
To confirm whether a misconfiguration in ''.htaccess'' is the cause of the 500 Internal Server error, either remove or rename the .htaccess file temporarily and then try to reload the page. | To confirm whether a misconfiguration in ''.htaccess'' is the cause of the 500 Internal Server error, either remove or rename the .htaccess file temporarily and then try to reload the page. | ||
+ | |||
+ | ==== Example 3 ==== | ||
+ | The following "Alias" directive in .htaccess will cause 500 on Apache (LSWS will ignore it without returning 500) since "Alias" directive is not allowed in .htaccess. | ||
+ | |||
+ | Alias "/" "/home/$USER1/public_html/" | ||
+ | | ||
+ | ==== Example 4 ==== | ||
+ | Syntax is wrong for the followintg directive: | ||
+ | Header always set Strict-Transport-Security: max-age=63072000; includeSubDomains; preload | ||
+ | |||
+ | which will lead to "Too many arguments to directive" error in error_log: | ||
+ | |||
+ | [Tue Sep 11 19:59:40.864917 2018] [core:alert] [pid 15738] [client 66.666.76.139:64740] /home/example/public_html/.htaccess: Too many arguments to directive | ||
+ | |||
+ | The correct syntax is the following and it should fix the 500 error for Apache: | ||
+ | Header always set Strict-Transport-Security: "max-age=63072000; includeSubDomains; preload" | ||
===== Different level of Rewrite rules misplaced to the wrong level ===== | ===== Different level of Rewrite rules misplaced to the wrong level ===== | ||
Line 82: | Line 98: | ||
Request exceeded the limit of 10 internal redirects due to probable configuration error. Use ‘LimitInternalRecursion’ to increase the limit if necessary. Use ‘LogLevel debug’ to get a backtrace. | Request exceeded the limit of 10 internal redirects due to probable configuration error. Use ‘LimitInternalRecursion’ to increase the limit if necessary. Use ‘LogLevel debug’ to get a backtrace. | ||
+ | |||
+ | ===== Incorrect Rewrite Rules misplace in differernt directories ===== | ||
+ | The following rewrite rules in subfolder is incorrect and it will cause 500 for LiteSpeed. | ||
+ | /home/user1/public_html/subfolder1] vi .htaccess | ||
+ | RewriteEngine On | ||
+ | RewriteCond %{REQUEST_FILENAME} !-f | ||
+ | RewriteCond %{REQUEST_FILENAME} !-d | ||
+ | RewriteRule ^(.*)$ subfolder1/index.php/$1 [L] | ||
+ | |||
+ | The correct rule should be: | ||
+ | /home/user1/public_html/subfolder1] vi .htaccess | ||
+ | RewriteEngine On | ||
+ | RewriteCond %{REQUEST_FILENAME} !-f | ||
+ | RewriteCond %{REQUEST_FILENAME} !-d | ||
+ | RewriteRule ^(.*)$ index.php/$1 [L] | ||
===== Improperly Configured php.ini ===== | ===== Improperly Configured php.ini ===== | ||
An improperly configured ''php.ini'' may lead to 500 error. | An improperly configured ''php.ini'' may lead to 500 error. |