anandkunal / ToroPHP

Toro is a PHP router for developing RESTful web applications and APIs.
http://toroweb.org
MIT License
1.17k stars 173 forks source link

Is there a simpler way to write such rule? #66

Closed phoenixg closed 11 years ago

phoenixg commented 11 years ago
// route rules
Toro::serve(array(
    "/" => "homeHandler",
    "/index.html" => "homeHandler",
));

how to make them one rule?

martinbean commented 11 years ago

/index.html shouldn’t match as, with ToroPHP being a PHP script, it needs to be ran from a file with a .php extension, usually index.php.

If you want users to see your home page when they go to /index.html then I suggest creating a 301 redirect in your .htaccess file.