EvanBot Robot

Comments (9)

Post Comment Back To Article

Travis

Sweet! Keep up the awesome posts man!

Nov. 15th, 2008 8:28 PM

Hugo

I'm getting the following error: Warning: preg_replace() [function.preg-replace]: Unknown modifier ')' in /xxx/xxxxx/xxxx/xxxxxxxxxxx/xxxxxxxxxxx/xxxxx/url-test.php on line 10
Array ( [0] => )

Obviously I've x'd out the real info. But can you help with this error? Thank you!

Nov. 16th, 2008 3:57 PM

Evan Byrne

@Hugo: Thanks for bringing that to my attention. turns out my blog script removed a necessary backspace character in the code. It should work now.

Also, you can see a live demo of this in action at the following URL.
http://www.evanbot.com/bin/index.php/whatever/another/anything

Nov. 16th, 2008 5:36 PM

Jordan

Very neat! The MVC design pattern comes to mind when looking at how you accomplished this. At least the front-loader design portion of it since you have no views or models.

Mar. 14th, 2009 2:03 PM

Evan Byrne

@Jordan: Actually, I have implemented this into my own PHP framework. I'll be releasing it some time soon so keep an eye out!

Mar. 15th, 2009 3:00 PM

Ack

You're code disappeared! Kinda dissapointing since so many others found it useful.

5:12 PM - June 23, 2009

Ravneel Chand

The code is still on the article page:
http://www.evanbot.com/article/fancy-urls-without-mod_rewrite/3

9:36 PM - July 10, 2009

Matt

Is there a way to do this while hiding the "index.php" ?
I have a folder called "blog" in my directory so that www.domain.com/blog accesses the index.php in the blog folder by default. However if I use the url www.domain.com/blog/18-jan it displays "page not found". www.domain.com/blog/index.php/18-jan works great though.

12:48 AM - July 11, 2009

Evan Byrne

Matt, that would require some mod_rewrite. Like so:

RewriteEngine on

RewriteCond $1 !^(index\.php|img|bin)
RewriteRule ^(.*)$ index.php?page=$1 [L]

9:08 AM - July 12, 2009

Post Comment

Capcha