Disclaimer

This information HAS errors and is made available WITHOUT ANY WARRANTY OF ANY KIND and without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. It is not permissible to be read by anyone who has ever met a lawyer or attorney. Use is confined to Engineers with more than 370 course hours of engineering.
If you see an error contact:
+1(785) 841 3089
inform@xtronics.com

Apache


System check - Syntax testing

$ apache2ctl configtest
$ apache2ctl -S

Redirect RedirectMatch Rewrite

First the differences

The choice depends on just what you need to do. Rewrite is complex - learning curve - but you can serve alternative urls without giving a HTML code. If you are only doing a simple redirection - possibly matching some urls - redirect is the way to go. When you can't do it with Redirect, you will probably want to start learning Mod_Rewrite.

Rewrite Notes

Flags

Rewrite Flags - multiple flags are separated by commas [C,B]

Matching and Escaping

Simple matching

^ 	Start matching at this point
$ 	End point of the match
. 	Any character
[] 	Starts a class
| 	Starts alternative match this|that would mean match this or that
() 	starts a back reference point
? 	match 0 or 1 time Quantifier
+ 	match atleast 1 or more times Quantifier
* 	match 0 to infinite times Quantifier
{} 	match minimum to maximum Quantifier {0,3} match up to 3 times

Class Definitions

Char. 	Definition
^ 	Negates the class. [^A-Z]+ means don't match any uppercases
\ 	Use before any of the following characters to escape or null the meaning or it. [\+]+
- 	Range for matching [0-9]+ [a-zA-Z]+

Apache error log

Ignore these

[error] Hostname 123.123.123.123 provided via SNI and hostname example.com provided via HTTP are different

From a bot that is using the IP rather than the domain name.

[error] [client 195.159.233.44] rejecting client initiated renegotiation

Someone probing TLS

www-prefix

Using a www-prfix advertised stupidity. www is spam and not useful Dump the www in your configs and register at http://no-www.org/


Top Page wiki Index