.htaccess redirect

RewriteEngine ON RewriteRule ^/.+ / [L,R] That will redirect everything to / as a permanent redirect. Look at http://httpd.apache.org/docs/2.0/mod/mod_rewrite.html for more information on the flags you can add for transparency etc etc. If you want this in .htaccess make sure you have the correct override directives in your <VirtualHost > config.

htaccess code to remove extension AND add+force trailing slash?

Try this: RewriteCond %{THE_REQUEST} ^GET\ /[^?\s]+\.php RewriteRule (.*)\.php$ /$1/ [L,R=301] RewriteRule (.*)/$ $1.php [L] The first rule redirects requests of /foo/bar.php externally to /foo/bar/. And the second rule rewrites requests of /foo/bar/ internally to /foo/bar.php. And to force the trailing slash, try this rule: RewriteCond %{REQUEST_FILENAME}.php -f RewriteRule .*[^/]$ $0/ [L,R=301]

How do I write a .htaccess file to make CodeIgniters URL routing work?

In your system/application/config/config.php, change $config[‘index_page’] = “index.php”; to $config[‘index_page’] = “”; and in your .htaccess, add this: RewriteEngine on RewriteCond $1 !^(index\.php|images|stylesheets|scripts|robots\.txt) RewriteRule ^(.*)$ /index.php/$1 [L] Add your .htaccess file to the same directory where the system folder is located, so in your CodeIgniter root directory, you should have system/ user_guide/ index.php .htaccess license.txt Also, … Read more