1

It's been a while since I've been heavy into webdev and I have a question about ?id=.

The website in question is not using a typical silo structure, as in: "example.com" > "example.com/about" > "example.com/contact" and so on, rather every page is using the same url, only changing the number at the end.

For example: Homepage = "example.com/index.php?id=0" about page = "example.com/index.php?id=1" contact page = "example.com/index.php?id=2" and so on.

My question is how exactly is the content being stored and called? each page is different but the url for every page is "example.com/index.php?id=*".

the website owner is looking for someone to update some info on the site and before I put myself forward for the task I thought it better to ask here first so I know what I'm getting into. I'm sure it's a task I can manage but as stated above, it's been a while and I'd rather not under estimate the work.

2 Answers 2

2

Most sites built with a CMS do something like this behind the scenes. The site is just not doing any routing in order to make the URLs appear in a search engine friendly / human readable format.

Each page of a CMS needs a unique ID so that it knows what content to generate at a specific URL. Routing takes this ID and uses it to generate a more readable format for a URL before displaying it to a user in such a way that two pages cannot lay claim to the same URL.

For example, the default "plain" WordPress URLs look like example.com/?cat=* for categories or example.com/?p=* for posts - which is basically the same approach as your site appears to be doing.

The content will almost certainly be stored in a database. It is not an approach you'd ever take if you were building a site in plain HTML.

You are probably best first finding out how it has been built before agreeing to a price for the work - I wouldn't take those URLs as a sign it is badly built, just that it has either been built by someone who doesn't care about SEO, or possibly was just built a long time ago when it was a pretty normal approach.

It may be built with a well known CMS and just needs configuring to use SEO friendly URLs.

2

This architecture is known as the front controller pattern.

All the pages in a website will have some common functionality - themes, images, session handling/authorization, caching policy.... The big benefit from using this method is that you separate the common content from the page-specific content and don't duplicate the former. It also makes it easier to wrap the site for delivery to different consumers e.g. mobile device rather than desktop, multi-language, multiple branding.

In addition to wrapping up the content, the front controller also has a component called the router which invokes the page specific content based on the identifier from the URL. Implementing an entire website in a single PHP script would be horrible, and very inefficient. The router has mappings defining an entry point for the content which it calls at runtime.

Its trivial to configure your webserver to give more semantically significant URLs - so there's a lot more sites using this pattern than you might expect from just looking at the URLs. Whether this has benefit for SEO is debatable. As usual there's lots of assertions but I've not seen any substantial evidence to support this. This process is known as URL re-writing - note that this is very different from redirection. The client browser never gets sent to look elsewhere for the content.

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.