The Slim Framework support forum has moved to http://discourse.slimframework.com. This Tender forum is no longer maintained or monitored.

How to change request URL in slim framerowk?

lpiernik's Avatar

lpiernik

16 Jun, 2015 09:16 AM

In my Slim API in developer version I'm using urls like http://api.developer.local/settings so in slim config I use simply $app->get("/settings");. It works great.

But in production version I need to use folder versioning like: http://api.production.local/v1.0.0/settings. That breaks all slim config (have to use additional group but I don't want to).

How in slim I can override request url?

EDIT: simply EDIT $_SERVER['REQUEST_URI'] - thanks

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

Generic

? 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