NGINX Mod_rewrite,子文件夹重定向到文件夹

时间:2016-10-27 05:56:17

标签: codeigniter mod-rewrite nginx configuration subdirectory

我是新手,我在NGINX中的重写模式有问题。

我给你环境: 我有2个应用程序:

  • 每一个www /
  • 另一个www / atri /

这两个app都需要是一个Mod_rewrite,所以我使用它:

location / {
try_files $uri $uri/ /index.php?$args;
}

这项工作完全适用于第一个应用程序,但是,当我继续第二个应用程序/ atri /这个加载所有的应用程序,如文件夹/ www /中的第一个应用程序的相同根。 你有想法在conf中分离2个应用程序吗?

有关信息,我使用codeigniter。

感谢您的回复。

2 个答案:

答案 0 :(得分:0)

尝试:

location / {
    try_files $uri $uri/ /index.php?$args;
}
location /atri {
    try_files $uri $uri/ /atri/index.php?$args;
}

有关详情,请参阅this document

答案 1 :(得分:0)

dispatch_source_t timer = dispatch_source_create(DISPATCH_SOURCE_TYPE_TIMER, 0, 0, queue);
dispatch_source_set_timer(timer, dispatch_walltime(NULL, 0), interval, leeway);
dispatch_source_set_event_handler(timer, block);
dispatch_resume(timer);

}

试试这个!

相关问题