I have a symfony 1.4 application called client with a module device. Here is part of the routing.yml file used in this application:
device_detail:
url: /device/:device_name
param: { module: device, action: show }
device_manage:
url: /manage/:device_name
param: { module: device, action: manage }
I can load the page http://example.com/client/device/jdoe without a problem. This page contains links generated using the link_to helper. For example,
link_to("Manage this device", "manage/{$device_name}")
generates the URL http://example.com/client.php/manage/jdoe.
My question is: why does the link_to helper generate a URL containing the string client.php rather than simply client? It seems strange that the page address uses client but thelink_to changes that to client.php.
Check your application’s
settings.ymlfile inapps/<YOURAPP>/config/settings.ymland adjust theno_script_nameconfiguration flag accordingly for the respective environment. Clear your cache afterwards. Normally your dev mode would haveno_script_nameset tofalse, and your production would have it set totrue.Example:
Edit: As dxb points out, this is also only valid for a single application in your project. If you have multiple apps in the same project you want this to apply to, you’ll need to apply a prefix to routes (eg
/admin), use a different domain/subdomain or similar solution.