.htaccess url rewrite - remove .php - add trailing slash - and shorten
query strings
I've been working on a CMS recently, and wanted to remove the .php add a
trailing slash and remove query strings e.g. index.php?page=contact to
index/contact
So far my .htaccess file looks like this:
Options +FollowSymLinks -MultiViews
# Turn mod_rewrite on
RewriteEngine On
RewriteBase /
RewriteCond %{THE_REQUEST} ^GET\ /[^?\s]+\.php
RewriteRule (.*)\.php$ /$1/ [L,R=301]
RewriteRule (.*)/$ $1.php [L]
other then that, I can't figure out how to shorten the query string. I've
looked around on and couldn't find any other questions specific to this...
Thank you in advance.
No comments:
Post a Comment