Thread: PHP Directories

    #1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2015
    Location
    Philippines
    Posts
    71
    Rep Power
    3

    PHP Directories


    Good day people!

    I'm curious about how people do make their file (index.php) open other links that result like a new directory?

    E.G

    www. example .com/index/aboutCompany

    where aboutCompany is a file? aboutCompany.php

    Thanks!
    Last edited by MonP; May 27th, 2017 at 09:51 AM. Reason: Redirects on other website
  2. #2
  3. Forgotten Moderator
    Devshed Supreme Being (6500+ posts)

    Join Date
    Mar 2007
    Location
    Washington, USA
    Posts
    16,180
    Rep Power
    9644
    They're using URL rewriting to make the web server process that as if it were /index.php?page=aboutCompany (or something similar to that). Then index.php has code to show the right content - yes, it could be a file aboutCompany.php, or it could be content from a database, or really just about anything.

    To learn more search around for "URL rewriting". Exactly what you do depends on the web server, like Apache and IIS and nginx all do it a little differently (because PHP isn't involved in that part), but the principles are the same everywhere.

    Comments on this post

    • MonP agrees
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2015
    Location
    Philippines
    Posts
    71
    Rep Power
    3
    Originally Posted by requinix
    They're using URL rewriting to make the web server process that as if it were /index.php?page=aboutCompany (or something similar to that). Then index.php has code to show the right content - yes, it could be a file aboutCompany.php, or it could be content from a database, or really just about anything.

    To learn more search around for "URL rewriting". Exactly what you do depends on the web server, like Apache and IIS and nginx all do it a little differently (because PHP isn't involved in that part), but the principles are the same everywhere.
    Thank you for your knowledge!

IMN logo majestic logo threadwatch logo seochat tools logo