I have a directory /mydir. If I put an index.html in there, it will open when someone browses to example.com/mydir, and their browser shows only the path, not index.html.

How can I get the same behavior, but opening a Wordpress page instead? I can put an .htaccess file there with DirectoryIndex, but that seems to only point to files, not Wordpress pages.

Alternatively, I could use

RedirectMatch "^/mydir/?$" "/mydir/some-wordpress-page/"

but then the page slug would show. (The page in question is a custom post type that has has "mydir/" as part of the base URL.) I basically want, in this directory, the desired page to work like the Wordpress home page.

  • 1
    Why do you need to create a physical directory?
    – MrWhite
    Aug 16 at 16:43
  • 1
    are you trying to reinvent subdirectory multisites? What problem does this solve for you?
    – Tom J Nowell
    Aug 16 at 16:53
  • I'd never heard of subdirectory multisites, but I guess the term might apply. This directory is for an organization whose website I am hosting with mine. They don't have the wherewithal to manage a complete website and Wordpress, and I don't want to manage two installations. They have always used html files (and a lot of older ones will remain so), but I'm helping them to learn writing in Wordpress. Aug 17 at 17:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.