We had an old site that had html pages in it. One of the pages in that site was linked to from many other sites.
Now we moved to a WordPress site, and we created a page with that name, but of course it doesn’t have the “.html” extension, so links to that page lead to an empty page…
I saw a plugin that adds html extesnsions to all pages, but I don’t want that – I have only one page to which I want to add .html.
What can I do to accomplish this?
I would just add a rewrite rule to your .htaccess file of something like:
Redirect 301 /oldpage.html http://domain.com/newpage/
see: http://www.javascriptkit.com/howto/htaccess7.shtml
You could add a rewrite rule to your theme that sends requests for
page.html
to the page itself. I’m not confident to supply code, but the rewrite documentation on this page is helpful. The last example there is the simplest illustration I’ve found of query rewriting.It helps to use ugly permalinks while you’re arranging it as you get to see what requests trigger what. If not, doing
print_r($wp_query)
will let you have the contents of the current query.