RewriteEngine On RewriteBase / RewriteCond %{QUERY_STRING} ^(.*)/$ RewriteRule ^(.*)$ /$1?%1 [R=301,L] RewriteRule ^(.*)/$ /$1 [R=301,L] DefaultType text/html DirectoryIndex index.php ErrorDocument 404 /404.php RewriteEngine On RewriteCond %{QUERY_STRING} ^(.+)$ RewriteRule ^(.*)$ $1@%1? [L] RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME}.php -f RewriteRule ^(.*)$ /$1.php [L] RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME}.css -f RewriteRule ^(.*)$ /$1.css [L] RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME}.js -f RewriteRule ^(.*)$ /$1.js [L]