I was trying to learn the htaccess basics but initial step made me go crazy and lost some precious time..
htaccess codes behaves differently when written in single line and when written in two different lines
the code below
RewriteEngine on
RewriteRule .* good.html
And the code below
RewriteEngine on RewriteRule .* good.html
Behave differently..
Please explain how it goes..
I guess, its because htaccess checks all the conditions first and then works..
but that too should not make it work like that..
Apache directives expect to be on a line by itself. So when you have:
The first “word” is the directive, e.g.
RewriteEngine. It looks for whether it should be on or off, and the next “word” ison. So far so good, the rewrite engine is turned on. But there’s a bunch of other crap after that and it’ll be ignored.But when you have:
The rewrite engine is turned on like normal. Then a
RewriteRuledirective is processed. The first “word” in the line isRewriteRule, so the params areRewriteRuleregex target [flags].So when they’re on different lines, everything gets internally rewritten to
good.html. On the same time, everything afteronis ignored.