How to remove index.php from url?

If you want to remove index.php and use mod_rewrite rules, you have to modify two files

  • lib/core/lhcore/lhdesign.php
  • lib/core/lhcore/lhmodule.php

lib/core/lhcore/lhdesign.php near line 26. Just replace from return $instance->WWWDir . '/index.php' . $instance->WWWDirLang . '/' . ltrim($link,'/'); to return $instance->WWWDir . $instance->WWWDirLang . '/' . ltrim($link,'/');

In file lib/core/lhcore/lhmodule.php replace from: header('Location: '. erLhcoreClassSystem::instance()->WWWDir . '/index.php' . erLhcoreClassSystem::instance()->WWWDirLang . '/' .ltrim($url,'/') ); to header('Location: '. erLhcoreClassSystem::instance()->WWWDir . erLhcoreClassSystem::instance()->WWWDirLang . '/' .ltrim($url,'/') ); also from: header('Location: '. erLhcoreClassSystem::instance()->WWWDir . '/user/login'); to header('Location: '. erLhcoreClassSystem::instance()->WWWDir . '/user/login');

Mode rewrite rules for apache looks like: RewriteEngine On
RewriteRule ^/var/[^/]+/cache/(stylesheets|images|javascripts?)/.* - [L]
RewriteRule !\.(gif|jpe?g|png|css|js|html|swf|php)|var(.+)storage.pdf(.+)\.pdf$ index.php
DirectoryIndex index.php
And lighttpd rules looks like url.rewrite-once = (
"^/(.*)\.(.+)$" => "$0",
"^/(.+)/?$" => "/index.php/$1"
)