Muliviews: Enable no extension for Apache under Virtualmin
To have nice and clean URLs in your app and hide the .php extension, you can enable Multiviews. If you use Virtualmin, see below how to achieve this.
First you select your virtual server, in this example "chatzone.tv", then expend "Services" and select "Configure Website":
Then click on "Document Options", it will bring you to this view:
Then turn on "Generate Multiviews" and don't forget to select "Selected below" !!
Then Restart Apache.
Wow that's such bad UX implementation... but that's another story
Important additional steps if you have HTTPS
Redo the steps above for your SSL endpoint if you want the same to work under https. Select your virtual server, in this example "chatzone.tv", then expend "Services" and select "Configure Website SSL". Then proceed as above!
Troubleshooting
Did you restart Apache? Try rebooting if you don't know how to restart it.
If you are on raw Apache without Virtualmin, just write this in httpd.conf
Options Indexes FollowSymLinks MultiViews ExecCGI
AddType application/x-httpd-php .php
The AddType is important otherwise it won't work, even if you PHP files are currently executing correctly when accessed with the .php extension.


Recent Comments