Getting WordPress blog entries in a /blog/ subdirectory

by clslaw
9 replies
  • WEB DESIGN
  • |
I have an existing website that is a static HTML site which is located in the main directory and is accessible by simply typing in the domain; e.g., http://www.mydomain.com.

I also have a WordPress blog installed in the /blog/ sub-directory; e.g., http://www.mydomain.com/blog/.

I want to replace the static HTML site with a WordPress site, but would like to keep the blog pages where they are. In other words, as new blog entries are made I want them to continue appearing in the http://www.mydomain.com/blog/ sub-directory but be able to create pages in and off of the main directory.

One thought was to simply leave the existing blog where it is and continue using it as is, and install a second Word Press site to generate the rest of the website.

I imagine there are other ways to get this done that might be better, so I thought I'd ask. I'm no WordPress expert, so when it comes to explaining how to get stuff down with WordPress it is safest to err on the side of excessive detail.

All help is appreciated!

Chris
#blog #entries #or blog or #subdirectory #wordpress
  • Profile picture of the author BlueLayerHost
    You can use one WordPress installation to manage both the site and your blog.

    However, it doesn't sound like this would be something you can do on your own as you'll need experience with HTML/CSS/PHP/WordPress in order to convert your HTML site to a viable WordPress theme.
    Signature
    BlueLayerHost - Shared + Managed VPS Hosting
    BlueLayerMedia - Web Development
    WPMalware - Resource for WordPress Seurity + Exploits
    {{ DiscussionBoard.errors[6163398].message }}
  • Profile picture of the author acharyabbs
    i think yu have to install word press in sub domain to access from there..
    {{ DiscussionBoard.errors[6163775].message }}
    • Profile picture of the author ryannmicua
      Hi Chris,

      I believe the easiest way for you to go about that one is to do what you initially thought of: leave the blog site the way it is and install a new WP site on the main domain.

      You could go with a more complex route of:
      1. installing a new WP site on the main domain
      2. importing your blog posts from the blog site
      3. Remove old blog site
      4. then setting up your permalinks in main site to /blog/%postname%/

      Your blog posts will now have the url example.com/blog/post-title

      and your pages will have the url: example.com/page-title

      Hope that helps you decide
      {{ DiscussionBoard.errors[6164653].message }}
  • Profile picture of the author Istvan Horvath
    I love it when "experts" jump in and give advice without fully understanding what the OP wants.

    On the other hand, I have to blame the OP, too, for not giving complete info.

    So, Chris, here are the questions you must answer before anybody can give you a meaningful answer:
    - what will happen with the content of the existing HTML site at the root of the domain?
    a) keep the content by converting it into WP posts/Pages?
    b) will the content disappear?
    c) what will be at the root, if the blog posts are going into the /blog/ folder?

    - what is the permalink structure on the existing blog in /blog/ folder?

    - what will be the design of the new site?
    a) based on the existing blog
    b) needs a theme based on the html site?
    c) doesn't matter

    If you have the answers for these questions... then we can advise you about the best solution.
    Signature

    {{ DiscussionBoard.errors[6166413].message }}
    • Profile picture of the author clslaw
      Originally Posted by Istvan Horvath View Post

      I love it when "experts" jump in and give advice without fully understanding what the OP wants.

      On the other hand, I have to blame the OP, too, for not giving complete info.

      So, Chris, here are the questions you must answer before anybody can give you a meaningful answer:
      - what will happen with the content of the existing HTML site at the root of the domain?
      a) keep the content by converting it into WP posts/Pages?
      b) will the content disappear?
      c) what will be at the root, if the blog posts are going into the /blog/ folder?

      - what is the permalink structure on the existing blog in /blog/ folder?

      - what will be the design of the new site?
      a) based on the existing blog
      b) needs a theme based on the html site?
      c) doesn't matter

      If you have the answers for these questions... then we can advise you about the best solution.
      I appreciate the help, everyone...

      That static content from the existing HTML site needs updating, so this is basically going to be a total site overhaul. The plan is is to revise much of the existing text from the static HTML site and re-purpose most of it as new WordPress pages. Permanent re-directs would be used to preserve the existing incoming search engine traffic.

      The root directory will be a home page that provides first time visitors a bit of information about the site, showcases upcoming live events, etc. The last three or four blog posts might be profiled.

      The current permalink structure for blog posts is http://www.mydomain.com/blog/2012/05/sample-post/, so I suppose the goal as far as the blog is concerned is to preserve that link structure. I have blog posts going back to 2009 and the idea of having to re-direct everything to a new link structure is something I'd rather avoid doing.

      The theme I intend to use is the same theme that is currently being used on the blog.

      Hopefully, I've hit all the bases here but if not let me know and I'll gladly update with any additional information that may be needed.

      Thanks, again.
      {{ DiscussionBoard.errors[6166742].message }}
  • Profile picture of the author Istvan Horvath
    In that case it is relatively simple

    Save the static HTML files (their content) and, eventually, re-write them to have ready for making WP Pages of them.

    You have, basically, two options - depending on how comfortable you are with editing files in your WP.

    1. Move the the WP install from /blog/ to the root AND set it (wp-admin > Settings > Reading) to have a a static page as frontpage
    - you will need 2 Pages created before this: one for home/front (and you can put your welcome message in its content); and another one left empty, no content with the name/title "blog"

    The welcome Page will be your home/front while your blog posts will be at example.com/blog/

    Then just add those Pages with the old content... and organize your Pages in meaningful hierarchy of parent and child (sub)Pages

    2. Leave the WP install where it is.
    Read: Giving WordPress Its Own Directory « WordPress Codex
    Follow the instructions to have the WP's main page shown at example.com instead of example.com/blog

    Then go through the setup described above for a static frontpage and another 'posts page'.

    ALWAYS make a backup of the wp-content folder and the database before messing with WP
    Signature

    {{ DiscussionBoard.errors[6167106].message }}
    • Profile picture of the author clslaw
      Istvan,

      Thank you for the information. It's very helpful and very much appreciated.

      I do have a question. The codex states as follows:

      Copy (NOT MOVE!) the index.php and .htaccess files from the WordPress directory into the root directory of your site (Blog address).
      No problem on the index.php file, but there is already a .htaccess file in the root directory. What, if any, issues do I need to concern myself with if I replace the existing file with the one from my WordPress installing directory?

      The file currently in the root director contains some RedirectMatch and a mod_rewrite command. Perhaps these can be combined in to a single .htaccess file?

      Thanks, again!
      {{ DiscussionBoard.errors[6177703].message }}
  • Profile picture of the author Istvan Horvath
    Perhaps these can be combined in to a single .htaccess file?
    Bingo!

    Yes, in this case you should combine your existing root .htaccess file's content and the content of the WP .htaccess (if any) in one single file.
    Signature

    {{ DiscussionBoard.errors[6181903].message }}
  • Profile picture of the author clslaw
    Much appreciated. Seems that I know what I'll be doing this weekend!
    {{ DiscussionBoard.errors[6183042].message }}

Trending Topics