Skip to main content

Posts

Showing posts from September, 2010

Removing the .php extension from Symfony controller

If you wish to shorten your Symfony 1.4 URLs (http://www.yourdomain.com/symfonyApp.php/user/login) by removing the php extension from the controller (http://www.yourdomain.com/symfonyApp/user/login), then read on. 1. Update your factories.yml file and add the relative_url_root option as described below: all: request: class: sfWebRequest param: logging: %SF_LOGGING_ENABLED% path_info_array: SERVER path_info_key: PATH_INFO relative_url_root: "" formats: txt: text/plain js: [application/javascript, application/x-javascript, text/javascript] css: text/css json: [application/json, application/x-json] xml: [text/xml, application/xml, application/x-xml] rdf: application/rdf+xml atom: application/atom+xml 2. Create a symbolic link in your web directory to your controller: cd /your/symfony/project/dir/web ln -s symfonyApp.php symfonyApp 3. Update your apache c...