5

A static front page and other pages which are children of it are used on a blog. To give an example:

www.example.com

The slug for that page shows up in the permalink for sub pages like www.example.com/long-slug-from-static-front-page/sub-page-slug.html.

The question now is how to make the URL Design more natural? Since the parent page is the frontpage, it's slug should be the sites homepage-URL (e.g. none as in http://www.example.com/) but the static pages slug is added instead.

I smell that this is a shortcoming in WordPress, any ideas?

I was asked to make the scenario more concrete by an Illustration because it was quite akward describben. Sorry. Aim is to use WordPress as a CMS to reflect the following structure (please not the other way round):

Illustration:

Logical Data and it's Structure:

  • Start
    • Blue
    • Red
      • Dark Red
      • Light Red
      • Burned Red
    • Yellow

Mapping of Data to Pages:

  • Start: Home-Page
    • Blue: Blue-Page
    • Red: Red-Page
      • Dark Red: Dark Red-Page
      • Light Red: Light Red-Page
      • Burned Red: Burned Red-Page
    • Yellow: Yellow-Page

URL Layout:

Is WordPress the tool for the job? Or does using page hierarchy and static front-page contradicts the URL layout?

3 Answers 3

2

WordPress does have a way of doing what you want. Make them all top level pages. Unless you have a good reason not to.

3
  • Good reason is to not change the logical structure.
    – hakre
    Aug 19, 2010 at 7:31
  • 1
    The logical structure (by which I assume you mean 'traditional and directory-driven') is to have them as top level pages, not subpages of the home page. If you had a static html site, example.com/ is really the index.html page in the root directory, which makes it a SIBLING of example.com/other-page.html, not a PARENT. Aug 19, 2010 at 13:02
  • Part of not changing the logical structure is to discuss it but it won't change. You asked for a reason :)
    – hakre
    Sep 8, 2010 at 18:45
1

Not exactly, WordPress determines it's query from the URL structure, so:

www.example.com/my-sub-page/ would be the exact same structure as www.example.com/my-other-top-level-page, so WordPress would have no way to tell if you are looking for a subpage or a top level page.

Having said that, I don't think WordPress lets you have the same slug for a sub level page and a top level page - so there shouldn't be a reason. If you require that permalink structure, why not just have your "sub pages" as top level pages. If you want them to be at www.example.com/my-sub-page/ then it sounds like they are pretty 'top level' anyway.

6
  • Oh you just read it wrong: I'd like to have www.example.com/sub-page-slug.html instead of www.example.com/long-slug-from-static-front-page/sub-page-slug.html. while being the subpage a childpage from that static page that is used as front-page. So to have subpages to the home page (one root for all pages that is the homepage). And not like you write the same slug. It's it's own slug, not a dupe to any of the other subpage's slugs or even the home (of which should not appear in the URL because it's slug is empty as by definition of the homepage).
    – hakre
    Aug 18, 2010 at 11:38
  • 1
    @hakre: please provide illustration of what you are after with a code or psuedo code tree in your original question. Prose description is hard to follow.
    – kevtrout
    Aug 18, 2010 at 13:25
  • @hakre Whether the slug is unique or not doesn't make any difference. If you want the pages to be www.example.com/sub-page-slug/ just use top level pages, I am not sure why you want to do this, the URL structure should reflect the page structure.
    – Joe Hoyle
    Aug 18, 2010 at 13:35
  • Seconding kevtrout, your written description is incredibly confusing. Please provide an illustration, or link to an example. Aug 18, 2010 at 14:37
  • What if you just made your Permalinks set to %postname%? Does that help your situation?
    – Volomike
    Aug 18, 2010 at 20:13
0

Your sub-pages should NOT be children of the 'homepage'. I know people draw sitemaps like that but it's really not how it works.

So you have:

Example.com (using static front page 'home') Example.com/about (a top level page, NOT a child of 'home')

There are no SEO or User experience problems from this approach, it is how most CMS sites are done.

1
  • that's basically what John already told and then you're adding SEO which is not part of the question. Misleading answer.
    – hakre
    Aug 19, 2010 at 7:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.