Third party cookies may be stored when visiting this site. Please see the cookie information.

Home Family Days Out Raspberry Pi & Electronics Blog

Stewart's Blog

Stewart Watkiss website to the world ...

(Children, computing, first aid and other ramblings ...)

Apache mod_rewrite – Conditional ReWrites using RewriteCond

The mod_rewrite Apache module can be used on a web server to dynamically change the web page returned to the end user. It has a number of potential uses including: creating user friendly urls to hide complex backend software pages; redirecting from old web pages when a site is redesigned; redirecting to a completely different website (eg. used by the url shortening sites such as; or sending visitors to different pages depending upon their IP address / region / browser.

I’ve been using mod_rewrite on my websites for many years, but with a few exceptions the rules I used were fairly basic. I’ve now found that I wanted to extend the features I use and have therefore looked at RewriteCond rules a bit more.

I’ve expanded my Apache Mod_Rewrite tutorial to explain how Rewrite Rule Conditions can be used to increase the power of mod_rewrite.

Please leave comments using the facebook comments below.

UK days out, children and holiday information is also available on the Days Out Diary web site
Linux, LPI and the Quiz / Test Program posts are also available on the Penguin Tutor website
First Aid Information, first aid games and first aid practice test / quiz entries are also available on the First Aid Quiz Web site