Hi all,
I’m wondering if anyone ever needed to use .php extension for symfony pages. e.g. you may want to make your urls look like http://domain.com/home.php or http://domain.com/mypage.php. If so here is the solution:
First of all dont forget to enabled suffix option in your apps/frontend/config/settings.yml:
.settings:
suffix: .php
Then important to add the line which would take care of .php files in .htaccess file:
# we skip all files with .something
# comment the following 3 lines to allow periods in routes
RewriteCond %{REQUEST_URI} \..+$
RewriteCond %{REQUEST_URI} !\.php$
RewriteRule .* – [L]
In your routing.yml you use the same code as normally:
mypage:
url: /mypage
param: { module: index, action: mypage }
And that’s it 🙂
We hope it was helpfull, wish you great day!