|
 |
|
|
06-03-2008, 05:56 PM
|
HTML or PHP?
|
Posts: 2,071
Name: carl
Location: UK
|
I am sure this has been asked before but have trawled through the posts and cant find anything.
From an SEO or ranking point of view which is better, to name your pages .html or .php? does the .php extension have an adverse effect on rankings? I dont believe it does but for my own sanity thought I better ask in a place where I actually trust the answers.
i have looked at various web sites, some say .html is always better, some say it makes no difference. Some say you should include a mode rewrite to change the .php to .html..???
The reason I am asking is my new site will have a php include to a form and the form will be on every page, so every page needs the .php extension (from what I understand anyway)
Can someone (who actually knows) please clear this up for me as the more I read the more confused I get, Chrishirst, Vangogh, VM if your reading...... 
|
|
|
|
06-03-2008, 06:44 PM
|
Re: HTML or PHP?
|
Posts: 5,662
Name: John Alexander
|
Well, the first question is are you targeting the main search engines, the ones everybody has heard of? Or do you want to come up #1 in the http://www.find-only-pages-with-funny-names.com/ search engine?
Google, Yahoo, MSN, Ask, and the other bunch that your customers are likely to know about, rank content, almost in absence of how it's presented. Sure, things like <title> and <h3>tags</h3> will have a real impact, and there's debate that the domain name has some effect. Even the page, according to some - but this seems to be exact matches. Which means if somebody searched for pagename.html that might be a bad thing if you chose PHP for your extension.
Really, though, it just doesn't matter.
|
|
|
|
06-03-2008, 07:14 PM
|
Re: HTML or PHP?
|
Posts: 960
Name: Darren
Location: England
|
I cant believe I clicked on that link John....
Really thought you'd discovered a new search engine I should know about!
The whole PHP / Html thing really is not important (as long as you dont have a page that is cached as one or the other and then change it later...)
The SE will still read the page content exactly the same (except for the PHP code itself)
__________________
I Just a test to see what happens... Please login or register to view this content. Registration is FREE
"Let us be thankful for the fools. But for them the rest of us could not succeed..."
|
|
|
|
06-03-2008, 07:34 PM
|
Re: HTML or PHP?
|
Posts: 2,071
Name: carl
Location: UK
|
thanks for the replies
Quote:
(as long as you dont have a page that is cached as one or the other and then change it later...)
|
once the new site goes up, a number of the page extensions (including the main/index page) will be changed from html to php, so would this make a difference?
|
|
|
|
06-03-2008, 07:51 PM
|
Re: HTML or PHP?
|
Posts: 1,228
|
Largely I'd say it doesn't matter, except that I've heard that some search engines have trouble with URL parameters, which are the part of the URL that have a question mark followed by a string (ex: http://www.yoursite.com/index.php?article=15). However, I've never heard anyone mention which have the problems. Google doesn't and I doubt Yahoo or Live do either. Beyond those three, it doesn't really matter because the other search engines of note are at least partial syndication channels of one of the three.
That said, there are other things to consider. I've heard some people mention that it's safer to have an .html extension on any public page because it hides the type of server code you are running. I'm not sure how much I buy into that theory as a security method, but you can certainly do that using mod rewrite.
What I think is even better than naming a file with an extension, though, is not having an extension at all. You can use mod rewrite to create search engine friendly URLs, like http://www.yoursite.com/articles/my-first-article. This method is going to be a lot more search engine friendly, but it's also more user friendly as well. This is an interesting article that talks about the URL as a User Interface that I think you will learn a lot from.
For using the Apache rewrite, here is a guide and a cheatsheet. Hope that answered your question.
|
|
|
|
06-03-2008, 08:17 PM
|
Re: HTML or PHP?
|
Posts: 5,662
Name: John Alexander
|
Not having an extension at all is maybe a good thing. It can be user friendly.
All search engines have trouble with query string parameters, for the record. For the longest time Google said no more than 2. They've relaxed that a bit, although even just 1 will cause major headaches, if that 1 is SessionID, for unrelated reasons. I think at this point, Google says you shouldn't have too many? The thing about query string params is that http://www.store.com/checkout.php?buy=new_car is an entirely different parameter from http://www.store.com/checkout.php?buy=shaving_creme. That's the case if you get a self hosted WordPress blog, too - it's going to default to http://www.w.com/?id=27 for your blog post. Naturally, 27 and 28 are different.
These are entirely differnet URLs. In the old days, the thinking went that a page with a bunch or ( seemingly random!) queries could have any number of unique variations, and the search engine can't be expected to guess them all. Nowadays, they find links to the important ones, like any other URL.
I've heard the same thing about using .html to hide the underlying technology, but it doesn't have merit. Your server headers contain a "powered by" field that points to Apache and PHP. Anybody clever enough to attack your site with the knowledge that it runs PHP, will also have the knowledge to check the headers.
Of course, changing everything to .html for the user's sake can be a good thing! And just to complicate matters further, on that note, some people say just .htm is better because a few people never left the 8.3 era.
|
|
|
|
06-03-2008, 08:19 PM
|
Re: HTML or PHP?
|
Posts: 41,517
Name: Chris Hirst
Location: Blackpool. UK
|
It's got to be .asp
Works for me anyway:
but joking aside:
It doesn't matter in the slightest WHAT extension (if any) you use.
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
|
|
|
|
06-03-2008, 08:22 PM
|
Re: HTML or PHP?
|
Posts: 41,517
Name: Chris Hirst
Location: Blackpool. UK
|
Quote:
Originally Posted by bakerc
once the new site goes up, a number of the page extensions (including the main/index page) will be changed from html to php, so would this make a difference?
|
Yes it certainly will. Ensure that you 301 redirect old URLs to new and it will reduce the time it takes to pick up the new site structure to somewhere between 3 to 6 months. Without the redirect; it may never happen.
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
|
|
|
|
06-03-2008, 08:46 PM
|
Re: HTML or PHP?
|
Posts: 2,071
Name: carl
Location: UK
|
What if I set the server to parse the .php on a .html site, without changing theh .html extension (I do not fully understand this yet but have been and will continue to read up on it) will this mean I can have .php scripts running on a .html site??
|
|
|
|
06-03-2008, 08:51 PM
|
Re: HTML or PHP?
|
Posts: 1,228
|
You can embed php code into html, but your server does need to be set up to parse php.
An example:
PHP Code:
<p>This is HTML code.</p> <?php echo '<p>This is PHP code</p>'; ?> <p>This is more HTML code.</p>
|
|
|
|
06-03-2008, 08:55 PM
|
Re: HTML or PHP?
|
Posts: 2,071
Name: carl
Location: UK
|
thanks VM
So just to clarify....
thats what I was thinking about, if I do this, will this stop me having to set up a load of 301 redirects as mentioned earlier by chrishirst (and stop any delays getting the new pages up and existing pages lost in the SE results)
can I still use a server side include for the form (which I have been doing lots of reading up on) and set the server to parse the .php code within an .html site without altering the .html extension (or any extensions)
Last edited by bakerc; 06-03-2008 at 08:57 PM..
|
|
|
|
06-03-2008, 08:59 PM
|
Re: HTML or PHP?
|
Posts: 1,533
Name: Paul Davis
Location: San Francisco
|
If it really bothers you, you can use mod_rewrite on your apache server.
Then in your .htaccess file:
Code:
Options +FollowSymlinks
RewriteEngine on
RewriteRule ^(.*)\.htm$ $1.php [nc]
Then users, search engines, and everybody else will see the .html extension but your pages will still have the .php
Reality is it doesn't matter. However, if you changed to a real server (Apache Tomcat) and drop php, all your public url's can stay the same (though you could map JSPs to be served with a php extension, people will make fun of you).
|
|
|
|
06-03-2008, 09:06 PM
|
Re: HTML or PHP?
|
Posts: 10,688
Name: Steven Bradley
Location: Boulder, Colorado
|
Looks like most of your questions have already been answered.
If you set the server so it will parse .html as PHP you shouldn't need to redirect anything since the URLs won't need to change. You could also use SSI which doesn't require PHP.
Before worrying about the 301s do the pages in question get much search traffic? If they don't I wouldn't worry too much about redirecting and the temporary loss in traffic. If you're not getting useful search traffic then it's not exactly a big deal to temporarily lose that traffic.
It also shouldn't take too long for the 301s to take effect. Redirecting to different pages on the same domain is different than redirecting to pages on another domain. As soon as search engines come by again to look at the old URLs they'll find the new ones.
|
|
|
|
06-03-2008, 09:18 PM
|
Re: HTML or PHP?
|
Posts: 2,071
Name: carl
Location: UK
|
Cheers guys, just wanted to clear it up in my own head - thanks a lot.
Will set the server to parse the files just wanted to get it straight in my own head on how to proceed.
(my host will help me out with this if needs be I am sure, left 123-reg now and the people I am with now offer proper support)
Thanks again.
Last edited by bakerc; 06-03-2008 at 09:26 PM..
|
|
|
|
|
« Reply to HTML or PHP?
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|