views:

29

answers:

0

hello,

My question ist about htaccess redirecting everything to bootstrap.php. My index.php is just pure html about a frameset (i know frames are uncool, but I must). So I redirected everything in the htaccess to bootstrap.php and now am trying to build a URL-Router. But somehow, it does not work.

When i request an URL like f.e. http://example.com/index.html, it does not redirect to bootstrap, where i have a switchconstruct to ask which controller was requested. If no predefined controller was requested (like "index") than redirect to default

switch(Registry::get('myrouter')->getController()) {
case 'news':
    //get the news controller
    break;
case 'userlogin':
    // get the login controller
    break;
case 'search_site':
    // get the search controller
    break;
default:
    header('Location: http://' . $_SERVER['HTTP_HOST'] . '/');
    break;

}

Why doesn't it work with index.php oder index.php. And what is the best way to write a URL router without using one of codeigniter or cakephp?

Thanks for help to everyone.