Posts Tagged 2.4

Apache 2.4.x Better than rewriting

With httpd Apache 2.4.x is is more simple to do stuff than with 2.2.x

Like forcing the www. in front of a domain. Apache now supports the If Elseif Else :-) Pretty nice!
Light example

<If "$req{Host} != ''">
    RedirectMatch (.*)$1

Easy, isn’t it?

A bit more old fashion way, so you can use the %{bla} stuff you already know.

<If "%{HTTP_HOST} == ''">
Redirect permanent /

Also nice is the Define Directive.

OK you have to start apache with the -D parameter. Like httpd -D TEST

<IfDefine TEST>
Define servername
<IfDefine !TEST>
Define servername
Define SSL

If you have some example, please let me know!

Tags: , , , , ,

first script for mod_lua apache2.3/2.4

function handle(r)
	r.content_type = "text/html"
	--r.headers_out["X-Powered-By"] = "mod_lua; " .. _VERSION
	return apache2.OK

Mod lua expects a function with the name handle() else there is a 500 Error. The error handling is pretty anoying…

Tags: , , , ,

Archives by Subject:

Archives by Month: