Concrete 5: .htaccess redirect - add .html extension
If you want to add .html extension to the end of the URL, try the code below in your .htaccess file. Also make sure Pretty URL is enabled from Dashboard.
RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME}/index.html !-f RewriteCond %{REQUEST_FILENAME}/index.php !-f # Rewrite rule for displaying as directories #RewriteRule ^(.*)$ index.php/$1 [L] # disable this # Rewrite rule for appending .html RewriteRule ^(.*)\/$ $1.html [R] RewriteRule ^(.*).html$ index.php/$1 [L]
Hey thanks a lot for this post...m a newbie...:)
ReplyDeleteits not working
ReplyDeleteI thought it was working when I tried. I'd like to hear from other people too regarding this.
Deleteits not working
ReplyDeleteLet me know if you've found a better solution?
Delete