How to remove index.php in url in zend framework -
i have installed zend framework website 1 server server.
eg: http://localhost/test/html ---- website url
where test folder---- zend framework files kept there.... index.php file under html folder.... , below display code index.php....
my website runs link "http://localhost/test/html"
where test folder
this below .htaccess code
rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewriterule ^(.*)$ index.php/$1 [l]
this index.php file under test folder
set_include_path('.' . path_separator . get_include_path() . path_separator . '../library' // . path_separator . '../application/classes/' // . path_separator . '../application/classes/forms/' // . path_separator . '../application/models/' . path_separator . '../application/default/classes/' . path_separator . '../application/default/classes/forms/' . path_separator . '../application/default/models/' . path_separator . '../application/bo/classes/' . path_separator . '../application/bo/classes/forms/' . path_separator . '../application/bo/models/' . path_separator . '../application/bo/controllers/' . path_separator . '../application/helpers' ); require_once "../library/zend/loader/autoloader.php"; //session_start(); define("site_path", "http://localhost/test/"); define("site_bo_path", "http://localhsot/test/bo/"); define("url", "/html/"); define("bo_url", "/html/bo/"); define("base_url", "/html/"); define("lib_url", "/library/"); define("img_url", base_url . "public/img/"); define("img_bo_url", base_url . "public/img_bo/"); @zend_loader::registerautoload(); $options = array( 'layout' => 'layout', 'layoutcontent' => '../application/views/layouts/', 'contentkey' => 'content'); new dbinitialize(); date_default_timezone_set("europe/berlin"); zend_layout::startmvc($options); zend_session::setoptions(array('save_path'=>'/vlk_session')); if(isset($_cookie["zend_auth_rememberme"]) && $_cookie["zend_auth_rememberme"] !== false){ zend_session::rememberme("5302000"); setcookie("zend_auth_rememberme", false, time(), "/"); } if(!zend_session::isstarted()){ zend_session::start(); } $sessionuuid = new zend_session_namespace("vlk_jsessionid"); $sessionuuid->setexpirationseconds(6000000); if(!isset($sessionuuid->uuid)) { $sessionuuid->uuid = uniqid('vlk_'); } $options = array( "adapter" => 'csv', "content" => 'languages/en.csv', "locale" => "en" ); $translate = new zend_translate($options); $_lingua = "it"; if(isset($_cookie["lingua"]) && ($_cookie["lingua"] == "it" || $_cookie["lingua"] == "en")){ $_lingua = $_cookie["lingua"]; } $translate->getadapter()->setlocale($_lingua); zend_registry::set('zend_translate', $translate); $controller = zend_controller_front::getinstance(); $_router = $controller->getrouter(); $_router->addroute('backoffice',new zend_controller_router_route_static('business',array('module' => 'bo','controller' => 'index','action' => 'index'))); $_router->addroute('fanpage',new zend_controller_router_route_static('business/fanpage',array('module' => 'bo','controller' => 'facebook','action' => 'index'))); $_router->addroute('profile',new zend_controller_router_route_static('business/profile',array('module' => 'bo','controller' => 'useredit','action' => 'profile'))); $_router->addroute('video',new zend_controller_router_route_static('business/video',array('module' => 'bo','controller' => 'gestionevideo','action' => 'lista'))); $fpcfrontendoptions = array( 'lifetime' => 7200, 'debug_header' => false, 'regexps' => array( '^/index/index/' => array('cache' => true) ) ); $fpcbackendoptions = array( 'cache_dir' => 'tmp/' ); $fullpagecache = new zend_cache_frontend_page($fpcfrontendoptions); $zcb = new zend_cache_backend($fpcbackendoptions); $fullpagecache->setbackend($zcb); //echo "test cache"; $fullpagecache->start(); //$controller->setcontrollerdirectory("../application/controllers"); $controller->setcontrollerdirectory(array( "default" => "../application/default/controllers", "bo" => "../application/bo/controllers" )); $controller->throwexceptions(true); // should turned on in development time // run! $controller->dispatch(); ?>
but when call controller eg. http://localhost/test/index.php/cp
want remove index.php file. in .htaccess file or in index.php file in zend framework.
plz provide me suggestion.
omega, docroot of vhost? or test folder off of vhost?
Comments
Post a Comment