The Slim Framework support forum has moved to This Tender forum is no longer maintained or monitored.

Application Redirect does not work properly

jose_navas's Avatar


25 Feb, 2014 05:45 AM

I have installed my Slim application in a sub-directory called "emedrec", but then when I run the code below:

// new Slim App with default settings
$app = new \Slim\Slim();
    'templates.path' => './templates'
// home page
$app->get('/', function () use ($app) {

I get redirected to the index URL located in the web document root (localhost). For example:
If I write the following URL: localhost/emedrec/
I get redirected to: localhost/index
When the correct redirect would be: localhost/emedrec/index

I'm not sure if I need to configure something in the Slim instance or add a RewriteBase directive in the Apache .htaccess file... so far adding a:
RewriteBase /emedrec/

Does not work... :/

Any thoughts on this will be appreciated.


Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:


Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts


? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac