## redirect/ %category%/%postname%.html to /%category%/%postname%

Question

My site was first built with html/css in 2000, and when I rebuilt it with WordPress in 2012, I kept the .html extension in the interest of keeping the same URLs. I’d like to get rid of it now and redirect the old html pages to the new extension-less pages.

/%category%/%postname%.html

I’d like it to be:
/%category%/%postname%

To do that, I tried deleting “.html’ from the end of the permalink structure, then saving permalinks. Then, I put this in my .htaccess:

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}.html -f
RewriteRule ^(.*)1.html


But it doesn’t work — pages just give me 404 errors that way.

I took a look at the Yoast permalink redirection tool, but that only redirects to /%postname% — I’m not sure if it’s possible to modify the outputted rule to add the category before the postname.

0
6 years 2017-09-20T15:30:48-05:00 0 Answers 52 views 0