My htaccess is as follows:

<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteRule ^moreinfo/(.*)$$1 [R=301]
    RewriteRule ^healthsolutions/(.*)$$1 [R=301]
    RewriteRule ^(.*).html$ $1/ [R=301]
    RewriteRule ^(.*).htm$ $1/ [R=301]

I am now using wordpress rather than straight html coding. The rewriterules above work to forward all of the old .html and .htm pages in the root directory and in /moreinfo/ and /healthsolutions/ directories. Unfortunately they also strip .htm and .html from wordpress pages (I thought they all ended in php initially). Now I see some of the basic functions like opening up the image editor in the visual editor of wordpress end in .html (using them produces a 404 error).

So the question is: is there any way to restrict my rewriterules to certain directories, so WordPress functions are not hindered?

Any help is appreciated!

Read more here: htaccess rewriterule. I don’t want all of them rewritten – How to exclude some pages?


If you know the solution of this issue, please leave us a reply in Comment section, to update the question.

Wordpress related questions and answers: