user3542294
user3542294

Reputation: 11

how to rewrite a single URL to add .html in wordpress

I ported an old static HTML site to wordpress. All posts and pages now have permalinks /%postname%/

I need a single post URL to include the .html extension (it needs to match the original canonical URL which included the .html)

EXAMPLE:

www.domain.com/thispageonly/

-TO-

www.domain.com/thispageonly.html

This is needed for a single post only nothing more.

Thank you!

Upvotes: 1

Views: 513

Answers (1)

ek9
ek9

Reputation: 3442

It's best to use 301 redirect for this (SEO reasons):

RewriteEngine on
Redirect 301 /thispageonly /thispageonly.html

Upvotes: 1

Related Questions