Question

When I create a post/question like this one for example. How does stackoverflow use it? I mean, does it create a new page for the question or does it turns it into pieces and puts the pieces together on a single dynamic page?

I've read that creating a new page would be bad because it would put a heavy strain on the server. But its good for SEO right?(not sure) on the other hand, generating a dynamic page is a lot less heavy on the server, but I'm not sure when it comes to SEO.

So how do websites like stackoverflow handle the content? Generate new pages or just a single dynamic page? or maybe they do something else that I just haven't read or heard of?

Was it helpful?

Solution

Its all generated dynamically and URL is just made keyword rich, for it search engine friendly.

Its done in most web servers by rewriting the URL so that a search engine could find the important keywords within the URL

In Apache HTTP server, a rule in .htaccess file would rewrite the request URLs to convert into actuall parameters that the processing script can use

for e.g. a URL like this

http://www.example.com/forum-name-3/topic-name-28/22/

would be converted to

http://www.example.com/index.php?forum=3&topic=28&page=22

by using this simple rule in .htaccess

RewriteRule ([0-9A-Za-z-\+._]+)-([0-9]+)/([0-9A-Za-z-\+._]+)-([0-9]+)/([0-9]+)/$ ./index.php?forum=$2&topic=$4&page=$5

If you are using Apache HTTP server, then you can find all fancy things here

You'll need to make the rules as per your needs, the example above is just for the sake of explaining how it works, so it may need some tweaking for making it work.

OTHER TIPS

I'm not familiar with stackoverflow.com architecture but usually it works following these two principles

1) generate a permalink url for the new post/question 2) this permalink url is handled internally and converted into a dynamic url

e.g. https://stackoverflow.com/questions/14995745/how-do-websites-like-stackoverflow-work might be easily converted internally as https://stackoverflow.com/questions/?id=14995745

a permalink url is all you need for SEO

I will tell about the CMS which I have designed in our project.

When the user submits the article/news, we create the XML on the server side containing the details of article.For e.g.

modules/cms/YYYY/MM/DD/<<title>>-<<unqid>>.xml

XML str is similar to this-

<blog>
  <title>..</title>
  <author>..</author> 
  <comment>...</comment>
</blog>

When i save the XML, I store the meta-data about the content in DB as well( articleId,title,author,status,comments,voteupCnt,viewcount etc.)I also extract the keywords from the content using some technique and store them in DB.Storing meta-data in DB helps me to do the searching faster.

I have written the controller to read article based on url

www.xyz.com/article/YYYY/MM/DD/title-unqid

This controller will read the XML modules/cms/YYYY/MM/DD/-.xml and display it in HTML.It will also have the keyowrds in meta tag of HTML to make it SEO friendly.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top