martins Posted May 13, 2010 Share Posted May 13, 2010 Hi - I'm new in PHP town so if you could kindly show me the way to the palace of wisdom, haha I'm wondering what is 'better' (I know it is not an appropriate word): 1. to create a website with index.php and other pages .php as well 2. to create .html pages (index.html, etc.) with php code within php tags? That's of course that the website will be using php and accessing mysql. Sorry, it's a silly question, but everyone has once been a newbie. TIA Quote Link to comment https://forums.phpfreaks.com/topic/201679-what-extension-of-website-pages-html-or-php/ Share on other sites More sharing options...
trq Posted May 14, 2010 Share Posted May 14, 2010 By default, php won't execute within html files and in reality, there is no benefit to using html over php. Quote Link to comment https://forums.phpfreaks.com/topic/201679-what-extension-of-website-pages-html-or-php/#findComment-1058042 Share on other sites More sharing options...
martins Posted May 14, 2010 Author Share Posted May 14, 2010 First of all, thank you for your response. So what you're saying is that it is more convenient to build .php pages? Quote Link to comment https://forums.phpfreaks.com/topic/201679-what-extension-of-website-pages-html-or-php/#findComment-1058047 Share on other sites More sharing options...
haku Posted May 14, 2010 Share Posted May 14, 2010 I've read in the past that .html pages get a better page rank thank .php pages. I don't know if it's still true - It was quite a while back that I read that (about 4-5 years ago now). One advantage to using .html extensions is that people won't know what language you are using to power your site. That adds a tiny bit of security (only a tiny bit mind you). Most servers however won't parse PHP in .html documents by default. You will need to either change the server settings, or else add some code to your .htaccess file to do this (google 'parsing .html as PHP' or something like that). Quote Link to comment https://forums.phpfreaks.com/topic/201679-what-extension-of-website-pages-html-or-php/#findComment-1058316 Share on other sites More sharing options...
Mchl Posted May 14, 2010 Share Posted May 14, 2010 Whatever you read about SEO 4-5 years ago is probably bollocks right now. And remember that with tools like mod_rewrite you can hide all your extensions, or get even further and change .php to .asp (I've seen one site that claimed to be running .NET port of WordPress ) Quote Link to comment https://forums.phpfreaks.com/topic/201679-what-extension-of-website-pages-html-or-php/#findComment-1058321 Share on other sites More sharing options...
martins Posted May 14, 2010 Author Share Posted May 14, 2010 Thanks phpfreaks - .php it is then. Quote Link to comment https://forums.phpfreaks.com/topic/201679-what-extension-of-website-pages-html-or-php/#findComment-1058335 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.