如何在 CI 和 Laravel 之间设置路由


How to set routing between CI and Laravel

我有两个不同的模块,一个是代码点火器模块,第二个是laravel5模块。

我的问题

是否可以在这两个模块之间设置公共路由?

我正在使用CI v2.2.6Laravel 5.0我尝试过.htaccess但我无法执行我想要的。

我在模块 Ex CI中有一些页面:

/home
/login
/signup
/otherPages

我在laravel Ex 中有一些页面:

/product
/buy
/edit
/otherPages 

现在我想访问

 mywebsite.com/home
 mywebsite.com/product
 and all

我该怎么做?

.htaccess

<IfModule mod_rewrite.c>
RewriteEngine On
#RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . control.php [L]
</IfModule>

创建文件控件.php

 #split the path by '/'
  $params     = split("/", $_SERVER['REQUEST_URI']);
    define("FILE_PHP",".php");
    define("ERROR_404","404.php");
    define("INCLUDE_ADMIN","index.php");
    class Loader{
     public function __autoload($params) {
         if(isset($params[1])==TRUE){ 
          if (file_exists($params[1].FILE_PHP)) { 
              require_once $params[1].FILE_PHP; 
              return true; 
          } 
           require_once ERROR_404; 
          return false; 
         }else{
          require_once INCLUDE_ADMIN; 
          return TRUE; 
         }
    } 
    }
    $loader=new Loader();
    $loader->__autoload ($params);