1# Apache Rewrite Rules
2 <IfModule mod_rewrite.c>
3 Options +FollowSymLinks
4 RewriteEngine On
5 RewriteBase /
6
7# Add trailing slash to url
8 RewriteCond %{REQUEST_FILENAME} !-f
9 RewriteCond %{REQUEST_URI} !(\.[a-zA-Z0-9]{1,5}|/|#(.*))$
10 RewriteRule ^(.*)$ $1/ [R=301,L]
11
12# Remove .php-extension from url
13 RewriteCond %{REQUEST_FILENAME} !-d
14 RewriteCond %{REQUEST_FILENAME}\.php -f
15 RewriteRule ^([^\.]+)/$ $1.php
16
17# End of Apache Rewrite Rules
18 </IfModule>
19
1# Run Php without filename extension
2RewriteEngine on
3RewriteCond %{REQUEST_FILENAME} !-d
4RewriteCond %{REQUEST_FILENAME}.php -f
5RewriteRule ^(.*)$ $1.php
6
7# Return 404 if original request is .php
8RewriteCond %{THE_REQUEST} "^[^ ]* .*?\.php[? ].*$"
9RewriteRule .* - [L,R=404]