• I currently have a website with about a hundred pages that I have coded myself in HTML. Within this website, in a sitename/blog folder, I have a WordPress blog. The HTML & WordPress pages are styled the same.

    I want to upgrade to a new WordPress theme using the Genesis Framework, and I want to move all the HTML pages into WordPress as Pages. (This will change the URLs for each page (from sitename/folder/pagename.shtml to sitename/category/pagename, but I can deal with that with redirects in the .htaccess file.)

    But I have a fundamental problem. If I continue with WordPress in the blog folder (which will end up being the only folder in the root directory), all the Pages will have the URL sitename/blog/category/pagename which is clumsy. But if I move the WordPress installation to the root directory to simplify the Pages URLs, I lose the connection with the database and the site crashes (I know because of I have been trying things out on a dummy site).

    So my questions are please:

    1. If I keep WordPress in the blog folder, can I alter the base of my Page URLs to remove the /blog from the URL? I imagine there will be a PHP file which sets this up?

    2. If I move WordPress to the root directory, is there any way to ensure I keep the connection to the database and so keep all my current posts, settings and comments? This would be the tidier solution, but riskier.

    Thanks.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The answer is yes to both. I would suggest moving the site to the root, but you can keep it in the folder if you’d like.

    You can read about how to make the transition (either one) at https://codex.www.ads-software.com/Moving_WordPress under the “Moving Directories On Your Existing Server” section.

    Have a read of that (it’s detailed), and if you have questions either before you do it, or as you’re working through, please do follow up.

    Thread Starter unklee

    (@unklee)

    Thanks Angela, I will check it out. I would prefer moving to the root, but I am a little scared of it as well. If I decide that is the way to go, I will try it on a test site first!!!

    Good idea.

    Thread Starter unklee

    (@unklee)

    Hi Angela, I’ve read that reference (and a couple of others it links to) and I must say I find the idea of moving WordPress from my blog subdirectory to the root directory pretty scary. So I think I’m going to keep it in /blog and try to set up the site around that decision.

    My process will be something like this:

    1. Switch to the new theme and get it all styled and good. This will be straightforward, though for a while the site will have two different looks for blog and for pages.

    2. Copy my key HTML pages into WordPress pages and style them. Again, this will be straightforward. Most people will visit the old pages but a few will find the new ones. The trick will be the URLs for these pages (see below).

    3. When I’m happy with this, start transferring all pages as quickly as possible. For a time, there’ll be 2 versions of every page.

    4. Set up a static/custom home page for the blog and style this. This should be straightforward.

    5. Make that page the site home page, not just the blog home page, to replace the exiting HTML home page (I think that means moving a couple of PHP files to the root).

    6. Use redirects in the .htaccess file to direct visitors from Google or with bookmarks to the new pages and take down the old HTML pages and folders & style sheets.

    To do that, I need to know a couple of things if you can help please:

    (i) The blog post URLs will stay sitename/blog/postname but I’m unsure how the pages will come out. It seems to me that they will be sitename/blog/category/pagename whereas I want them to be sitename/category/pagename. You said before this could be done, but I haven’t seen anywhere that tells me how. Can you point me in the right direction please?

    (ii) I’m worried that any change I make to permalinks structure will affect the blog posts as well as pages, so if I remove /blog from the pages, it will disappear from blog posts as well. Is there a way to change one but not the other?

    (ii) I have to be able to make the static/custom homepage accessible in the root directory. I think your reference show me that fine thanks.

    I know this reply has been long, but I want to be sure to get this right, so I thought I’d lay it all out there and hope you had time to read and answer please. Thanks.

    Thread Starter unklee

    (@unklee)

    I’m still wondering if anyone can help me please.

    At this stage I want to keep WordPress in the blog folder, keep post URLs in the form sitename/blog/category/postname, but eliminate the /blog from the page URLs.

    It seems I can’t take the /blog out using Permalinks so I’m wondering if I can do it this way: Use PHP or a plugin to remove the /blog from all URLs, then use Permalinks to add /blog back in for blog posts.

    Does anyone know, please, (1) if that will work, and (2) either a plugin that changes the base of the URML or the location of the PHP code that controls this?

    Thanks.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Integrating an existing website with WordPress’ is closed to new replies.