I have used several URL Rewriting engines in my career and one of my favorites is the Apache mod_rewrite. It is a very powerful rewrite engine and today I learned something new about it. Basically, I was browsing the Practical Driving Test Booking page and I noticed a message saying that this system is only available between 6AM and midnight. That’s when it occurred to me that URL rewriting could be used for doing such a thing.
I started looking for this and sure enough this is one of the features of mod_rewrite. Here is the code to achieve this :-
[xml]
RewriteEngine On
RewriteCond %{TIME_HOUR}%{TIME_MIN} >2359
RewriteCond %{TIME_HOUR}%{TIME_MIN} <0600
RewriteRule ^index\.cfm$ /systemdown.html [L]
[/xml]
The above code makes sure that the time is more than 23:59 and less than 06:00 and if it is, rewrites index.cfm to systemdown.html and the URL stays the same. No code changes required at all.
Now, that is cool!
Wish I had more to say here – but cool tip!
Yes Ray, this is definitely very cool 🙂
Thanks a bunch for sharing this with all folks you actually recognize what you’re talking approximately! Bookmarked. Kindly also seek advice from my web site =). We may have a hyperlink change agreement among us