2

As you know, a WordPress post can usually be seen going to a link similar to this:

myblog.com/2014/03/27/sample-post/

There is no folder named 2014, 03, 27 or sample-post in the blog.

Until now, I used something like this: page.php?post_id=55.

How is WordPress and other sites (I think StackExchange sites do this too) doing this?

  • 2
    Not exactly a duplicate but I think it explains things nonetheless: wordpress.stackexchange.com/a/139271/21376 – s_ha_dum Mar 27 '14 at 20:24
  • So it's a type of 404 error? And the 404 page takes the current like link (2014/03/27)? If this is how it works, than why wordpress is working on localhost without any .htdocs file there? – artur99 Mar 28 '14 at 20:25
  • 1
    No, it isn't a 404 error. That question is asking about 404 errors but in explaining that I more or less explained how WordPress URL rewriting works in general. – s_ha_dum Mar 28 '14 at 20:26
  • Oh, now i got it. So i need the mod_rewrite ? – artur99 Mar 28 '14 at 20:32
  • 1
    Yes, you will need mod_rewrite. WordPress doesn't set up mod_rewrite. That has to be installed on the server. WordPress will use it (or try to) if you enable pretty permalinks. – s_ha_dum Mar 28 '14 at 20:40
0

Not sure if you are asking how to do this, but it's a setting in Settings > Permalinks. You would select the Day and Name option. This should automatically format your Post articles in this format.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.