RewriteEngine On
RewriteBase /tarie-railings/

RewriteCond %{THE_REQUEST} /([^.]+)\.php [NC]
RewriteRule ^ /tarie-railings/%1 [NC,L,R=301]

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^(.+?)/?$ $1.php [L]

DirectoryIndex index.php
