.htaccess - htaccess append missing .html to URL -


i'm trying check if url ends .html , append if it's missing. i've tried solution past question i'm having no luck testing site: htaccess tester

previous questions: here, and here

so here's couple tries i've attempted:

method 1

rewriteengine on rewritecond %{request_uri} !^/some/thing/(.*)\.html rewriterule ^/some/thing/(.*)$ /some/thing/$1.html 

method 2

rewriteengine on rewriterule ^/some/thing/(.*)$ /some/thing/$1.html 

any tips or pointers? quite new .htaccess, in advance!

try rule:

rewriteengine on  rewritecond %{the_request} !\s/+.+?\.html [nc] rewriterule ^(.+?)/?$ /$1.html [l,ne,r] 

Comments

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

javascript - jQuery show full size image on click -