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:
- Home-Page: http://example.com/
- Blue-Page: http://example.com/blue/
- Red-Page: http://example.com/red/
- Dark Red-Page: http://example.com/red/dark/
- Light Red-Page: http://example.com/red/light/
- Burned Red-Page: http://example.com/red/burned/
- Yellow-Page: http://example.com/yellow/
Is WordPress the tool for the job? Or does using page hierarchy and static front-page contradicts the URL layout?
WordPress does have a way of doing what you want. Make them all top level pages. Unless you have a good reason not to.
Not exactly, WordPress determines it’s query from the URL structure, so:
www.example.com/my-sub-page/
would be the exact same structure aswww.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.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.