03 May 2010 06:37:05
Category: PHP Development
I wish some had showed me this along time ago. Anyone who has had to deal with the mystery of "What the hell is mod rewrite doing?" or have just started learning mod rewrite will appreciate this.
Add this to your vhost -- obviously not for production.
That will give you nice feed back like this.
applying pattern '^/blogs/([^/\.]+)?/?([^/\.]+)?/?$' to uri '/blogs/view/164'
rewrite '/blogs/view/164' -> '/blogs.php?mode=view&blog_id=164'
split uri=/blogs.php?mode=view&blog_id=164 -> uri=/blogs.php, args=mode=view&blog_id=164
There you go then all you have to do is learn regex.