codingmachine
Verified User
- Joined
- Dec 21, 2022
- Messages
- 14
Hello!
I am attempting to set up extensionless-PHP where you can access a PHP file without the extension.
Example:
https://example.com/file.php could be accessed like https://example.com/file
This would be the template I would need to apply, though I do not see where to apply this to a template file.
I know templates are stored in /usr/local/directadmin/data/templates/custom
But none of the Nginx files have a location / {} that I can see
Any help would be appreciated.
Thanks
I am attempting to set up extensionless-PHP where you can access a PHP file without the extension.
Example:
https://example.com/file.php could be accessed like https://example.com/file
Code:
location / {
try_files $uri $uri.html $uri/ @extensionless-php;
index index.html index.htm index.php;
}
location ~ \.php$ {
try_files $uri =404;
}
location @extensionless-php {
rewrite ^(.*)$ $1.php last;
}
This would be the template I would need to apply, though I do not see where to apply this to a template file.
I know templates are stored in /usr/local/directadmin/data/templates/custom
But none of the Nginx files have a location / {} that I can see
Any help would be appreciated.
Thanks