Differences
This shows you the differences between two versions of the page.
Last revision Both sides next revision | |||
litespeed_wiki:config:ifdefine-ifmodule-litespeed-apache-difference [2019/10/30 20:01] Jackson Zhang created |
litespeed_wiki:config:ifdefine-ifmodule-litespeed-apache-difference [2019/10/31 17:49] Lisa Clarke Copyediting |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== IfDefine/IfModule, LiteSpeed acts differently than Apache ====== | + | ====== IfDefine and IfModule Support ====== |
- | On Apache, sometime you may use [[https://httpd.apache.org/docs/2.4/mod/core.html#ifdefine|''IfDefine'']] or [[https://httpd.apache.org/docs/2.4/mod/core.html#ifmodule|''IfModule'']] to mark directives that are conditional. For example: | + | |
- | <IfDefine NothingInParticular> | + | If you are used to using [[https://httpd.apache.org/docs/2.4/mod/core.html#ifdefine|''IfDefine'']] or [[https://httpd.apache.org/docs/2.4/mod/core.html#ifmodule|''IfModule'']] with Apache, you will notice that these conditionals behave differently with LiteSpeed. For example: |
+ | |||
+ | <IfDefine ConditionToCheck> | ||
RewriteRule (.*) https://google.com [R=301,L] | RewriteRule (.*) https://google.com [R=301,L] | ||
</IfDefine> | </IfDefine> | ||
- | LiteSpeed doesn't support such conditional checking and will assume everything is defined or every module exists hence the directives enclosed within ''IfDefine'' or ''IfModule'' will be always executed on LiteSpeed, which is different than Apache's conditional checking behavior. | + | This is because LiteSpeed doesn't support ''IfDefine'' and ''IfModule''. |
- | Due to the implementation difference, ''IfDefine'' or ''IfModule'' is not recommended to use at all. | + | LiteSpeed will ignore such conditional checking and will always execute the directives enclosed within ''IfDefine'' or ''IfModule''. |
- | If you did use them already and still want a workaround to bypass them on LiteSpeed, you can manually add ''NothingInParticular'' (should be replaced by your particular definition or module name) to [[https://www.litespeedtech.com/docs/webserver/config/general#apacheIgnoredModules|" Ignore Apache Modules"]] to ignore the module/definition. | + | We do not recommend using ''IfDefine'' or ''IfModule''. If you already have such conditionals in use, and you'd like a work-around to allow you to bypass them on LiteSpeed, manually add ''ConditionToCheck'' (should be replaced by your actual definition or module name) to the [[https://www.litespeedtech.com/docs/webserver/config/general#apacheIgnoredModules|Ignore Apache Modules]] area. |