Home › Forums › Other › mod_rewrite fun › Re: mod_rewrite fun
November 15, 2012 at 7:36 am
#114412
Member
You are really close..
Try this:
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^(.*)$ $1.php
RewriteRule ^/index.php$ - [L]
RewriteRule ^about-us/([^/.]+)/?$ index.php?slug=$1 [L]
# added this line just in case someone goes to about-us without anything after it.. so you do not get a 404
RewriteRule ^about-us/?$ index.php?slug=$1 [L]