• Hello. I would like all of my Pages to continue to appear in the root, while having all of my Posts appear in a subdirectory “/blog”.

    Currently I have WordPress installed in the root. I have just changed my Reading Settings to have a static homepage and a posts page:

    https://www.jimpublic.com takes you to a page I’ve called “Browse Jim’s Stuff”
    https://www.jimpublic.com/?page_id=1386 takes you to a page I’ve called “Blog”

    I have always used default permalinks and have hard-coded many internal links to my other pages using these default permalinks, but I would love for the “Blog” page to appear as “https://www.jimpublic.com/blog” and for my posts to fall under that hierarchy in the URL. I have searched though the docs and forum and have found possible solutions, but they seem to involve changing all of my permalinks, which I would like to avoid, if possible.

    If I move WordPress to a subdirectory “/blog” will that change the permalinks of all my pages? If I have to move WordPress, would I create the “/blog” subdirectory in my current Theme folder?

    For my needs, I only want my Posts’ URLs to change, not my Pages’ URLs, but I’ll do what I have to do to get my “Blog” at “/blog”.

    Thanks!

Viewing 1 replies (of 1 total)
  • Thread Starter jamesphough

    (@jamesphough)

    Update.

    My awesome sister-in-law sent me this, which allows me to rename “/?page_id=1386” as “/blog”:

    hey,
    at your root folder, create a file called .htaccess
    in it, put this:

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /blog/
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /?page_id=1386 [L]
    </IfModule>
    # END WordPress

    This doesn’t create a subdirectory under which all further blog posts will fall, but it does accomplish my primary goal, which is to be able to easily tell people the URL of my blog, even if the actual blog posts are still in the root directory. Not totally elegant, but effective!

    I’d still like to know: does anyone know how to get the blog posts into a true subdirectory?

Viewing 1 replies (of 1 total)
  • The topic ‘Can I move posts to subdirectory and keep pages in root.’ is closed to new replies.