My htaccess file perfectly removes all file extensions from all php files which is fine, however I would need the file/page booking.php to be excluded from that and to be loaded with the .php extension. What is the best way to have this achieved ? I am using Apache 2.4.7 on Ubuntu 14.04
My current htaccess file:
<IfModule mod_rewrite.c>
Options +FollowSymLinks -MultiViews -indexes
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^mydomain\.com$ [NC]
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [L,R=301]
RewriteCond %{THE_REQUEST} \s/+sections/(.+?)(?:\.php)?[/?\s] [NC]
RewriteRule ^ %1 [R=301,L]
# remove index
RewriteCond %{THE_REQUEST} /index(\.php)?[\s?/] [NC]
RewriteRule ^(.*?)index(/|$) /$1 [L,R=301,NC,NE]
# remove .php; use THE_REQUEST to prevent infinite loops
RewriteCond %{THE_REQUEST} ^GET\ (.*)\.php\ HTTP
RewriteRule (.*)\.php$ $1 [L,R=301]
# remove index
RewriteRule (.*)/index$ $1/ [R=302]
# remove slash if not directory
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} /$
RewriteRule (.*)/ $1 [R=301,L]
# add .php to access file, but don't redirect
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteCond %{REQUEST_URI} !/$
RewriteRule (.*) $1.php [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule (?!^sections/)^(.+)$ /sections/$1 [L,NC]
</IfModule>
I've tried a few methods however with no result so far as always resulting in 404 and never preserving the file extension. Some expert help would be greatly appreciated