mercredi 22 avril 2015

PHP URL request rewrite and redirect

I am new to this kind of functionality. I saw this in action in several frameworks such as codeigniter, wordpress and more. It's the ability to rewrite the URL.

suppose i have a file system like

  • htdocs
    • pages
      • home.php
      • about.php
      • services.php
      • products.php
      • contact.php
      • and so on...
    • core
      • class_database.php
      • class_filesystem.php
      • class_account_manager.php
      • and so on...
    • index.php
    • config.php
    • and so on... How do i do it so that i can rewrite the url request like this. for instance a user request the home page, instead of accessing the home page via the URL: http://ift.tt/1yRG5I6, he'll just input example.com/home?

Is there any way to do this with only php code for the sake of mobility?

Thanks in advance for the help.




Aucun commentaire:

Enregistrer un commentaire