FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


What file extension should I use ?





FunDa
When making a site, is it better to use .htm or .html for the web pages ???

Does it have any advantage in different OSs or search rankings or anything at all ???

Also, if php is enabled, but I'm not using php now, should I make them .php files because I may want to add PHP content later ???
GB
I don't believe it matters whether you use .htm or .html. The reason .htm exists is because some older machines could only use 3 character extensions. Now days, I don't think there are computers like that hooked up to the internet and it is quite safe to use .html

I'm not sure about the .php question. Hopefully someone else can answer that one.
anticitizen1
FunDa wrote:
When making a site, is it better to use .htm or .html for the web pages ???

Does it have any advantage in different OSs or search rankings or anything at all ???

Also, if php is enabled, but I'm not using php now, should I make them .php files because I may want to add PHP content later ???


if you're thinking about search ranking, then is better to include php code in .html files.
{name here}
anticitizen1 wrote:
FunDa wrote:
When making a site, is it better to use .htm or .html for the web pages ???

Does it have any advantage in different OSs or search rankings or anything at all ???

Also, if php is enabled, but I'm not using php now, should I make them .php files because I may want to add PHP content later ???


if you're thinking about search ranking, then is better to include php code in .html files.

PHP won't be parsed in files with an HTML extension unless specified otherwise on the server.
FunDa
GB wrote:
I don't believe it matters whether you use .htm or .html. The reason .htm exists is because some older machines could only use 3 character extensions. Now days, I don't think there are computers like that hooked up to the internet and it is quite safe to use .html

I'm not sure about the .php question. Hopefully someone else can answer that one.


Thanks ... I personally prefer .htm .


Abut the PHP,
Quote:
if you're thinking about search ranking, then is better to include php code in .html files.


Should I keep as .html (or .htm) ?

Quote:
PHP won't be parsed in files with an HTML extension unless specified otherwise on the server.


How do u make the server parse html files for PHP ? Does it have any disadvantages (slows the server or security issues Question ) ?


Another question :

Should I keep an index.htm (or index.php) file in every folder and specify all links as to the folders but not to the files ? (So it won't matter if I change from index.htm to index.html to index.php to default.htm or whatever)
{name here}
FunDa wrote:

Quote:
PHP won't be parsed in files with an HTML extension unless specified otherwise on the server.


How do u make the server parse html files for PHP ? Does it have any disadvantages (slows the server or security issues Question ) ?

There is no reason to do so unless you want to fool your users. You can directly embed HTML into PHP.
Code:

<html>
<head>
<?php /* php stuff */ ?>
</head>
<body>
<?php /* HTML is pretended by the parser to be nonexistant, so you can continue here. */
</body>
</html>

This isn't reccommended for full blown templates because it ends up getting confusing and you will end up hurting yourself if you try to use cookies.
Quote:

Another question :

Should I keep an index.htm (or index.php) file in every folder and specify all links as to the folders but not to the files ? (So it won't matter if I change from index.htm to index.html to index.php to default.htm or whatever)

There is no need to keep an index.html in every directory unless your web server will show your files if there is no index file.
Dragonfly-online
As for plain html, I would just use the .html extension, as I think .htm is a little outdated

as for the .php extension, I would stay with html until you actualy have PHP content considering PHP requires a webserver to be set up to test, while HTML can be run without the need for a php server, and can be run without anything but a browser
{name here}
Dragonfly-online wrote:
As for plain html, I would just use the .html extension, as I think .htm is a little outdated

as for the .php extension, I would stay with html until you actualy have PHP content considering PHP requires a webserver to be set up to test, while HTML can be run without the need for a php server, and can be run without anything but a browser

Setting up apache and php for local use on Windows isn't that hard.
rheanna
Go with .php Cool Less maintenance.
Dragonfly-online
{name here} wrote:
Setting up apache and php for local use on Windows isn't that hard.


Depends

Anyway, you could, as I said, go with html simply because you probably dont have any PHP content yet
Marston
{name here} wrote:
Quote:
How do u make the server parse html files for PHP ? Does it have any disadvantages (slows the server or security issues Question ) ?

There is no reason to do so unless you want to fool your users. You can directly embed HTML into PHP.
Incorrect, mod_rewrite extention cloaking is more SE friendly.
{name here} wrote:
Quote:

Should I keep an index.htm (or index.php) file in every folder and specify all links as to the folders but not to the files ? (So it won't matter if I change from index.htm to index.html to index.php to default.htm or whatever)

There is no need to keep an index.html in every directory unless your web server will show your files if there is no index file.
However, if you dont want people snooping through your directories, you'll want to include an index.html or index.php file (usually blank).
MrBlueSky
Marston wrote:
However, if you dont want people snooping through your directories, you'll want to include an index.html or index.php file (usually blank).


Or put

Code:

Options -Indexes


in your .htaccess
frih
you can use .html or .htm. both are correct. the difference depends upon the scripts like CGI or software we use in webpages. some software uses .htm and some uses .html format.....


if you want to know more than please tell me

regards
abhi Idea
{name here}
Marston wrote:
{name here} wrote:
Quote:
How do u make the server parse html files for PHP ? Does it have any disadvantages (slows the server or security issues Question ) ?

There is no reason to do so unless you want to fool your users. You can directly embed HTML into PHP.
Incorrect, mod_rewrite extention cloaking is more SE friendly.

That's something you can do with PHP scripts. Something I did for my mediawiki powered site a while ago.

Quote:
{name here} wrote:
Quote:

Should I keep an index.htm (or index.php) file in every folder and specify all links as to the folders but not to the files ? (So it won't matter if I change from index.htm to index.html to index.php to default.htm or whatever)

There is no need to keep an index.html in every directory unless your web server will show your files if there is no index file.
However, if you dont want people snooping through your directories, you'll want to include an index.html or index.php file (usually blank).

You could also just chmod it to 666, or 644 and then nobody can view the directory but they should still be able to access the files IIRC.
Dragate
You don't need an index.html file AND an index.php... but if you want your index page to have php content, take out the html one, becuase sometimes servers will act stupid and there will be errors. It only displays one of those as the index page.

Personally, I use .html instead of .htm just becuase the file is a HTML file, so I think the l taken off isn't the full name for an html file, it was only made that way becuase before only 3 letter extensions work.

It's tottaly up to you.

Hope things work out fine ^^~
zanetine
from the point of view of Search engine optimization i will recommend you to use html extension only.

if you need any dynamic content coming from some database, or something like this then you will have to use some php code so your documents should end with .php extension.

but if you dont need any programming functionality then you should use .html only, as search engine robots index static pages more easily than a dynamic page like asp,php or cgi etc..
MrBlueSky
zanetine wrote:
from the point of view of Search engine optimization i will recommend you to use html extension only.

if you need any dynamic content coming from some database, or something like this then you will have to use some php code so your documents should end with .php extension.


There is no need to use the .php extension (or any other extension) if you don't want to. If you configure your server correctly you can put your php in .html-files.
zanetine
most people host websites on shared hosts, so they may not have acess to server configurations, so then if you want to have dynamic content then extension will be only that, what is allowed on server
FunDa
MrBlueSky wrote:
zanetine wrote:
from the point of view of Search engine optimization i will recommend you to use html extension only.

if you need any dynamic content coming from some database, or something like this then you will have to use some php code so your documents should end with .php extension.


There is no need to use the .php extension (or any other extension) if you don't want to. If you configure your server correctly you can put your php in .html-files.



How do we configure a server to read php from html files ?
Is it possible if u host the files on frihost ? Question
cavey
To make HTML-files behave like PHP-files:

Make yourself a textfile with the filename ".htaccess" (nothing before the ".", and no .txt-extension). In this file, put this in:

Code:
AddType application/x-httpd-php .php .html


Upload it to your website-root, where the first index-page is.

IMPORTANT! This is a hidden file! Make sure you can see hidden files in your FTP Client (check the manual if needed) to make sure you do not overwrite an existing .htaccess-file. If there is a .htaccess file there from earlier, you have to edit the existing file, and add the line, f.ex. at the bottom.

More info about .htaccess here: http://www.javascriptkit.com/howto/htaccess.shtml
MrBlueSky
FunDa wrote:


How do we configure a server to read php from html files ?
Is it possible if u host the files on frihost ? Question


Frihost rules! This is yet another thing that is possible at Frihost, while a lot of other (even paid) hosting providers don't allow this.

See cavey's post above on how to do it.

Frihost Applause
Related topics
req: PHP to list files in directory, and link to them
.htaccess tutorial
751 Useful Windows XP Files
Do we support php include and/or SSI?
Free Upload Space for your personal files list!!!
Cybot's Music Section
File unable to be downloaded
How to detect a file is that jpeg image or gif image ?
Urgent - Retrieving File Extension From A String.
How to prepare a true "GOOGLE XML" file - SITEMAP.
Search my sites folders for a certain file extension
Hide PHP file extension
file extension SYS
Interesting mistake - change extension on image
Reply to topic    Frihost Forum Index -> Webmaster and Internet -> Design Tips

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.