The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Other mod_rewrite fun Re: mod_rewrite fun


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]