Give help. Get help.

  • # January 5, 2013 at 6:57 pm

    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?

    # January 5, 2013 at 7:11 pm

    That’s what 301 redirects are for.

    # January 5, 2013 at 7:23 pm

    Thats awesome… Thanks Ben!

    # January 5, 2013 at 7:37 pm

    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.

    # January 5, 2013 at 10:35 pm

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

    # January 6, 2013 at 2:31 am

    > 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)

You must be logged in to reply to this topic.