When I use this code, it works just okay:
<IfDefine ${ServerBase}>
RewriteBase ${ServerBase}
</IfDefine>
But when I add this, it always uses RewriteBase \
which was not what I want.
<IfDefine !${ServerBase}>
RewriteBase /
</IfDefine>
The condition was already different. One of them when ServerBase is defined and one of them is when ServerBase is NOT defined. How can I use IfDefine else pattern with RewriteBase?
IfDefine
checks whether a parameter is defined or not. It doesn't check it's value.You need to use it as:
Note use of
ServerBase
instead of${ServerBase}
.Check official Apache doc of
IfDefine