Reputation: 2209
I have seen the use of href="blaah"
instead of href="blaah.php"
for the href
attribute of the a
tag. I have also seen href=".."
in the stead of href="index.php"
.
I have tested this on an NGINX server, but, when I host, I will probably end up hosting through Apache. So, is href="blaah"
supported by Apache?
Upvotes: 0
Views: 67
Reputation: 28
You can use RewriteEngine for this, just add this code to your .htaccess.
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^(.+)$ $1.php [L]
This code adds .php to every file without a extension.
Upvotes: 1