Trim .php extension using .htaccess

Trim your .php extension in your web application using .htaccess

RewriteEngine on
RewriteRule ^$ index.php
RewriteRule ^([a-zA-Z0-9\-\_/]*)/$ $1/index.php
RewriteRule ^([a-zA-Z0-9\-\_/]*)$ $1.php

Print Friendly, PDF & Email

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.