Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Other Should I name my website pages with the .php extension, even if there is no PHP in the code?

  • This topic is empty.
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #41776
    mitso
    Participant

    I was once told by a web design/development teacher that it is good practice to name your website pages with the .php file name instead of .html even if you have no PHP in your code.

    The reason for this is that if you name your web pages with the .html file name and then decide to re-design your site later on using PHP and change your web pages file names to .php, then you will lose your search engine position, break all the back-links on other sites and generally you will be starting all over again with marketing your site.

    I have been trying to find more information on this to verify if the teacher was correct, even though it does make sense, but I cant find anything to confirm that yes – it is a good idea to name your files with the .php extension even though you have no PHP code.

    Can anyone advise if this is correct or not?

    #119943
    chrisburton
    Participant

    That’s what 301 redirects are for.

    #119946
    mitso
    Participant

    Thats awesome… Thanks Ben!

    #119948
    Zoom
    Participant

    You could also configure your server to parse html files as php. For most hosts this can be done easily by adding 1 line in the .htaccess file.

    #119966
    JohnMotylJr
    Participant

    Naming your html files ‘php’ is truly haggard. It serves absolutely no purpose.

    #119972
    __
    Participant

    > Naming your html files ‘php’ is truly haggard. It serves absolutely no purpose.

    …and at the same time, it wastes server resources passing a file (that contains no php code) through the php interpreter, instead of simply serving it as HTML.

Viewing 6 posts - 1 through 6 (of 6 total)
  • The forum ‘Other’ is closed to new topics and replies.