routing

Discussion in 'Programming/Scripts' started by Kemp, Apr 17, 2026 at 2:12 PM.

  1. Kemp

    Kemp Member

    Hi,

    I have setup a routing system using php and nginx, as follows:

    index.php

    <?php

    $request = $_SERVER['REQUEST_URI'];

    switch ($request) {

    case '':
    case '/':
    require __DIR__ . '/directory1/index.php';
    break;

    case '/view/one':
    require __DIR__ . '/directory2/index.php';
    break;

    }

    --

    I have added the following to nginx directives in ISPConfig:

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

    --

    When I go to domain.com/view/one it's loading the /directory1/index.php file instead of /directory2/index.php

    Thank you!
     

Share This Page