• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

Changing the URL base

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

Community Forums › Forums › Archived Forums › Design Tips and Tricks › Changing the URL base

This topic is: resolved

Tagged: base, move, permalinks, subdirectory

  • This topic has 3 replies, 2 voices, and was last updated 6 years, 5 months ago by unklee.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • September 28, 2015 at 1:03 am #166815
    unklee
    Member

    Hi,

    I have purchased Genesis Framework and Minimum Pro theme, to upgrade an existing website and blog. My question is about WordPress rather than Genesis.

    My current website is composed of about a hundred HTML/CSS pages I have coded myself, in about 8 different subdirectories, with a WordPress blog in a /blog subdirectory. When I install Genesis I want to also convert all the HTML pages into WordPress pages. To maintain continuity, I want everything to have the same URL as now, which will be sitename/parentpagename/pagename for pages, and sitename/blog/category/postname for posts. But with WordPress in the /blog folder, the page URLs will be sitename/blog/parentpagename/pagename, which I don't want (it will look clumsy and break any bookmarks readers have).

    I know one way to achieve what I want is to move the blog out of the /blog subdirectory and use Permalinks to add the /blog to the post URLs, but this scares me as the process is complex and I'm worried I might lose contact with my database and so lose all the existing posts and comments.

    So this is what I want to do, if it is possible. I want to keep WordPress in the /blog folder and use a plugin or modify the PHP to take the /blog out of the URL base. Then I will add /blog back into just the posts using Permalinks.

    Can anyone please tell me if this is possible, and if so, is there a plugin to achieve it, or which file contains the PHP I would have to modify. Thanks.

    http://www.is-there-a-god.info
    September 28, 2015 at 7:30 am #166840
    Victor Font
    Moderator

    Permalinks are used globally by WordPress. If you add /blog to your permalinks, every page and post will have /blog/. Rather than mess with the permalinks, this should work if you create proper parent/child relations the pages, and parent/child categories for your posts. If you set permalinks to postname, the breadcrumbs and URL will show the structure you want.

    https://codex.wordpress.org/Using_Permalinks
    https://codex.wordpress.org/Pages
    https://codex.wordpress.org/Manage_Categories_SubPanel


    Regards,

    Victor
    https://victorfont.com/
    Call us toll free: 844-VIC-FONT (842-3668)
    Have you requested your free website audit yet?

    September 28, 2015 at 3:55 pm #166891
    unklee
    Member

    Hi Victor, thanks for your reply. But I'm sorry, I don't understand how to remove the /blog without moving WordPress out of the /blog directory.

    January 16, 2016 at 5:55 am #176675
    unklee
    Member

    I don't know if anyone will ever read this, but I have managed to make the WordPress static home page the home page for the whole website while keeping the WordPress install in the /blog directory and keeping the URL for posts as sitename/blog/postname.

    It was actually quite easy, so I thought I'd document it here if anyone else needs to do it.

    At the start, the main website (including the home page) was HTML, and the whole WordPress install was in the /blog directory.

    1. Go the WP Dashboard, Settings, General and change Site address to the root URL (but don't change the WordPress address) and save.
    2. Copy (not move) the WP index.php and .htaccess files into the root.
    3. Edit the index.php file (near the end) so that it reads require( dirname( __FILE__ ) . '/blog/wp-blog-header.php' ); instead of require( dirname( __FILE__ ) . '/wp-blog-header.php' ); and save.
    4. Login to site at old address, go to the Dashboard, Settings, Permalinks and reset permalinks by adding /blog - before I had filename/%category%/%postname/", now I have filename/blog/%category%/%postname%/
    5. Amend links in main menu as necessary.

    All done.

  • Author
    Posts
Viewing 4 posts - 1 through 4 (of 4 total)
  • The forum ‘Design Tips and Tricks’ is closed to new topics and replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2022 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble