Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Route to External Link
  • Hello everyone,

    I have a site with an application developed in fuelphp.
    I need to use another application in a .tld / newapp domain, but I obtain a 404 error

    How can I route this?
  • Harro VertonHarro Verton
    Accepted Answer
    You can not route to a URL, only to URI segments. But you can use a closure:

    'my/external/route' => function() {
        \Response::redirect('https://google.com');
    },
  • Hi Harro,

    Ok.
    But i have a site in www.domain.tld.
    An webapp in www.domain.tld/myapp
    And i want install other app (not developed for me, an app with own self enviroment and files) on www.domain.tld/other_app
  • Harro VertonHarro Verton
    Accepted Answer
    Doesn't really matter, if it is a URL external to the Fuel App you'll have to redirect to it.
  • One more question.

    If i have fuelphp app into path/to/public/<fuelphp folder> for domain.tld
    And i want create other app into path/to/public/<other_app>

    How can i use this other_app from domain.tld/other_app

  • That should not be a problem I think, although I've never tried it.

    Install the index.php and the .htaccess file in your other_app folder, and make sure that index.php has the correct APPPATH, COREPATH etc set. Two apps can not share an app folder, but they can share everything else (core, packages, modules, composer vendor).

    The only possible issue might be if "domain.tld/other_app" is requested, so without a trailing slash. This will probably picked up by your main app, instead of loading the root page of your other_app. If that is the case, you need to add a rewrite rule to your main app's .htaccess file to make sure it's rewritten to "domain.tld/other_app/" or "domain.tld/other_app/index.php". You'll have to try to see what works.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion