How should I set up this pagination

On my website, I’m implementing pagination when I get to 11 articles. Right now, on my homepage, I list the articles right now, and I’ll have pagination at the bottom of the page when it’s time. I’m wondering how the URLs should look.

Like, I have this currently

www.codefundamentals.com/

I don’t want to do something like this…
www.codefundamentals.com/page/2/

Since that just doesn’t look right (someone tell me I’m right please. Maybe it’s just me but this URL looks bad and just doesn’t…“fit”. Does anyone see this how I see it?)

How should this be set up? How would you? Would you have a separate page (almost replicating the front page) which might be something like this (this page would be in the blog folder.)

www.codefundamentals.com/blog/page/2/

I could make that page the index page for hte blog folder…but then I run into duplicating the content and making it two pages…Some general advice would be appreciated.

Generally these are URL variables and interpreted by the backend. Another way of writing this would be:

www.codefundamentals.com/blog?page=2

It looks like you’re using PHP, so you’d want to do URL rewriting and pick up the variables with $_GET['page'] then use that id to pull it from your db. Since it doesn’t look like you’re using a CMS, you could do this pretty much any way you wanted.

https://www.addedbytes.com/articles/for-beginners/url-rewriting-for-beginners/

You could set this up fairly easily in something like WordPress and I think this style is default.

Yes I was going to use a rewrite to handle ?page=2. Should have mentioned that.

I wasn’t asking about the rewrite though. I’m well aware of rewriting and all of that. Thanks anyway for trying.

The 2 is the variable used to pull from the db. It’s generally not a logical file or folder structure.

I’m aware of everything you are saying mawburn. You are missing the point of this thread. I don’t need code advice. I need advice on how the URLs should look.

I know everything about pagination. I need help on figuring out how the URLs will look due to how the website layout is.

Or rather, what’s the best approach to the URLs , not HOW they will look*.

However you want really, there’s not really a predefined structure. If you go and look at the way it’s implemented across the different CMSs and sites, then you’ll see it doesn’t really follow a set pattern. Just however the developer felt at the time and whatever was logical to them.

Personally, I use short abbreviations for major sections of the site to cut down on the length of the url. Looking at the URL above, Discourse does too. /t/[threadname]/[some id or something]/[post number]. The first /t/ probably stands for thread. It emphasizes the thread name so that when it’s linked, that’s the only thing that is human readable.

On my old website I had my article list in my blog folder. So pagination would look pretty normal.

www.codefundamentals.com/blog/page/2

Something like that. My articles are listed on the homepage now INSTEAD, so that same pagination would look weird, as seen below.

www.codefundamentals.com/page/2/

I am aware there is no one-size-fits-all. I’m asking what the community would think is a good way for this to look like. Whether it’s one of the above examples, or a third option someone makes up…something. I’m asking for opinions on what a good URL would look like. That’s it. That’s what I would like ideas on. Be creative! Creative ideas would be helpful. I don’t need or want code advice at the moment; only brainstorming.

Yes, right… mine was it doesn’t matter. Nobody is going to look at the url on a paginated page.

And then I explained why, gave examples, and gave some suggestions for other options.

So… :expressionless:

1 Like

Others might not look at it, but I will.

I’m aware this ultimately doesn’t matter but it’s not something I’m going to ignore just because I can be lazy about it.

Also others might try and directly access my pagination results (I do for other sites), so I’m trying to find what people might find intuitive.

Your discourse examples don’t really help considering they have apples and I have oranges.

Why not do what sites like CSS Tricks do and have a link below the articles on the home page that takes you to an archive page, which you can then paginate?

www.codefundamentals.com/
www.codefundamentals.com/archive
www.codefundamentals.com/archive/2 

I was thinking about that but wouldn’t the first page of the archives page be duplicate content? Or should I set it up so that google doesn’t index the page1 example you gave (/archive) and just make that mirror the homepage?

I do like how they have it set up but it is duplicate content.

In my opinion it makes more sense for the archives not to duplicate the articles from the home page, so /archive/1 would contain articles 12 and up.

I realise this isn’t how CSS Tricks do it, but I don’t know how they handle any duplicate content problems (you could try asking around in the SEO forum).

Yeah I didn’t want duplicate content so that’s why I threw it out. Perhaps I can force google to not index page 1 (robots.txt? Doing so via google webmaster tools? Ideas?)

@TechnoBear hangs around in the SEO forum, so any thoughts?

So far your archives idea, @fretburner, has been the best. Thank you for your input.

Google’s solution is for pages to use “canonical”

1 Like

Perfect!!!

That means that if I include this on my index page (e.g. what will be displayed on archive/page/1)

<link rel="canonical" href="http://www.codefundamentals.com/index.php" />

That means that Google won’t index archive/page/1 (or rather, they say they promise to try really hard not to…)?

Is my logic correct?

Irrelevant for this thread, I know, but I think it’s “topic” since we have topics now, as opposed to threads.

2 Likes

Yes but it is a waste.

I would be tempted to split the topics into groups such as HTML, CSS, frameworks, etc

Problem is, most of my articles can fit into the HTML category, or CSS categoryl.

It’s not like I have a wide range of subjects.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.