How to properly handle no-content "middle" pages?

Hello,

I have a URL that looks like:

http://foo.com/category/dogs

If someone were to manually navigate here:

http://foo.com/category

… and, there is no content (intentionally) to be shown at the above location …

Question: What would be the best way to stop people from visiting the no-content “middle” pages (like above)?

My first thought would be to 301 redirect the user back to the home page.

What’s the best way to handle this situation? I’d like to avoid putting content on the “category/” page just for the sake of it.

Hope that makes sense.

TIA!

I’m guessing this is a “pretty URL” that uses redirects?

I don’t know how complex your site is, but I think I would rather have a link to a non-existent folder go to a page listing an index of its pages rather than going to “home”. Though perhaps an HTML sitemap might be a good alternative.

The main thing is to help visitors that are “lost” be able to find what they’re looking for. Maybe a site “search” page would work?

A better way is to avoid redundancies in the URL in the first place - ‘category’ isn’t a directory so it has no business being shown as one. Why not just have foo.com/dogs?

Hi Mittineague and Stevie! Thanks so much for the help, I really appreciate it! :slight_smile:

Yah. It’s WordPress. I would’ve posted in the WP forum but I have run into this situation for non-WP systems in the past, so I was trying to keep my question general.

Sorry I did not give details. This is for a very simple WP personal blog/portfolio. I’m trying to keep everything über simple (in design and back end setup).

That’s a good idea actually (sitemap or search). I really like the sitemap idea. So, would you say that a 301 redirect to a sitemap page (thus changing the URL in an SEO-friendly way) would be appropriate? Or, should I send some other status code (like 403, maybe)?

That’s a great point. Unfortunately, WP makes it tough to remove those bits (I’m trying to avoid using plugins here).

Maybe the best thing for me to do is to just go the more traditional route and just have a list of categories on the /category landing page. Gosh, writing it out loud here, that seems like the most obvious solution.

In general though, I have run into this problem in the past … I’ve always wondered the best way to handle pages that don’t have content, but could be manually accessed if someone decided to remove things from the URL. I’ve worked with many-o-systems that put superfluous bits in the URL. Normally I’ll 301 redirect to the closest parent location, or maybe use a 403.

Sorry if I’m rambling.

Thanks again Mittineague and Stevie! :slight_smile:

I’d always go for displaying an index of sub pages when you get to /category.

Depending on your content structure it may or may not be useful to have a simple list of links, or provide more information such as category image + category title + category description, or even selected entries… think of it as a visitor, if you landed on that page what information would help you achieve the task you want to do?

That’s great advice. Thanks bluedreamer (and thanks again to everyone else too)!