Forum Moderators: coopster
My webmaster has recently gone from very active to 'semi-detached', which means I'll have to spend more time on this side of things <shivers>.
Because I'm a dunce I've asked him to change the site from its present .php format back to .html as I think this will make it easier for me to make small changes to the site independently. He's concerned this will affect our SE rankings. Will it?
What can I ask him to do about incoming links? Most point to mysite.com which I guess won't be affected, but some point to mysite.com/something.php.
Cheers.
To deal with external links that point to php pages, you should tell your webmaster to set up the php pages to have a 301 redirect to the new html pages.
Actually, just my two cents, but it's really not so hard to edit php files, you might want to just leave them as they are and save yourself the trouble.
But sometimes is better to learn a bit of php to be able to modify the site than going back to the past with your html version.
You can have plain-old HTML pages with a .php extension. The only disadvantage there is it may be slightly inefficient. (Since you were running PHP anyway, you shouldn't have a problem.)
That way, when you (or someone you hire) gets up to speed with PHP, you won't need to switch the extensions back again.
Welcome and I have to agree - don't change the extensions (and thus change the URLs). You have a few options
1. learn some basic PHP and leave as is.
2a. have the site made into a static html site as requested, but simply set your server to treat *.php files as *.html files
2b. use mod_rewrite to rewrite all *.php urls to *.html, which would have roughly the same effect as option 2a.
... probably several others.
I don't know whether options 2a and 2b make sense to you. If not, ask away.
If it's a small, simple site, any of those options will work. If you have lots of pages, though, it's going to become a terrible hassle if you make it static. You'll almost certainly end up with broken links or pages where the site navigation is not up to date.
If you just don't have time and you want a site that you can just edit from something like Frontpage, you'll be stuck with one of the the other options.
Learning .php is a non-starter, beacuse I still haven't learned .html except at the most basic level.
Seems then like the best option is the one recommended by ergophobe & timster which is to keep the extension .php, but with the file behaving as .html as far as the editing by me is concerned (if I understood correctly).
But I wonder how this may be 'slightly inefficent' as timster mentioned. Is this worth worrying about?
In future, try to avoid dipping your hand, so to speak, to your visitors. It's none of their concern what happens inside your webserver, don't you agree? I've stopped using extensions and file system-like formattign of my urls years ago, and have never looked back. Changing the internas of my server has now no effect on my link structure and urls.
Please use the tools at tyour disposal, your webserver software and server OS. There is no reason to use file extensions (or even files) in your urls, and both, I and the w3c recommend that you do not.
Let's all try for a better web.
Regards,
SN
That way, if you needed to edit some information that changes from time-to-time, you could do it with a Web form, and you wouldn't need to learn HTML. On the rare instance you need to change something else, you can get your webmaster or another pro to help you out.
If it's HTML changes, and you want to get into the formatting and stuff, it would be enough in many systems only to know the html, and to change this in the template. If it uses a less-advanced template system, this comes down to only knowing the php statments 'echo' and 'print' - the parts that 'output' the HTML. Learning the 'real easy stuff' in php can be even easier than learning some parts of HTML.
Maybe what would be best of all is to find some free php content management system and a template or 'theme' whose layout appeals to you, change that layout just a tiny bit by adding your logo or whatever, and run with that. If it can be just a basic blog thingie, check out wordpress. If you need lots of topical organization and whatever, and maybe some special modules to create graphs of the monthly hotdog consumption of the population of Decatur, Illionis, or maybe something to open your cans and clean your upholstered furniture, check out a cms like postnuke (recently added caching capability and short-url support, which seem really nice).
This is a perfect time to sing my sermon again.
Reverend Killroy, I used to make that sermon too, but got tired of repeating myself. I think that having established the urls for many pages, he should keep them. You're right though. If you are going to change the urls, absolutely don't change from /path/to/file.php to /path/to/file.html but rather to /path/to/file
The only reason to have file extensions in urls is laziness (which is why a site that I did recently for free for someone has them).
If he can afford it, some basic admin tools would be the way to go, but if the webmaster is a no-show as he said in the initial post, that might be a problem too.
Tom
How about some links again to direct interested folks. The W3C link killroy is referring to, I'm assuming, is Cool URIs don't change [w3c.org].
But back to the question of ranking. One thing you could do is just let httrack make a copy of your site (or some other rippier) that will just put the whole kaboodle into HTML, and make nice HTMLish url's for you. Pages will take a while to get indexed again, but in general page rank should be restored since you've got the same url structure pretty much, even though the url's themselves may differ. In fact, if you've got real greasy url's like mysite.com/thisfile.php?this=whatever&that=otherthing&thisnextparameter=ohnowaytoolongurl,
your rankings might improve.
Thing is, though, if people are linking *inside* your site, and aren't likely to change their links to your new ones any time soon, you can make these php files (or php files w/parameters in them) send out server headers to tell where the new page is, which usually also helps preserve pagerank. You do that by making your php file like this - say it's file.php?x=bugsbunny&y=donaldduck that's the old page address - and the new page is at bugsbunnyanddonaldduck.html (I made this php code to be explicitly long and unoptimized to make it newbie-readable), your old file.php should look like this:
<?
if($_GET['x'] == 'bugsbunny' && $_GET['y'] == 'donaldduck') {
header("HTTP/1.1 301 Moved Permanently");
header("Location: ht*p://yoursite.com/bugsbunnyanddonaldduck.html");
header("Connection: close");
} elseif($_GET['x'] == 'kermit' && $_GET['y'] == 'misspiggy') {
header("HTTP/1.1 301 Moved Permanently");
header("Location: ht*p://yoursite.com/kermitandmispiggy.html");
header("Connection: close");
/* above code forwards yoursite.com/file.php?x=kermit&y=mispiggy (and yoursite.com?y=misspiggy&x=kermit) to the html address above)*/
} elseif($_GET['yo'] == 'momma' && $_GET['army'] == 'boots') {
header("HTTP/1.1 301 Moved Permanently");
header("Location: ht*p://yoursite.com/yomammawearsarmyboots.html");
header("Connection: close");
/* above sends yoursite.com/file.php?yo=momma&army=boots, as well as yoursite.com?army=boots&yo=momma (the this=that pairs order generally shouldn't matter) to the html file address above*/
}
/* keep on adding elseif statements according to above template for each page that's linked from outside your site and end with the following*/
else {
header("HTTP/1.1 301 Moved Permanently");
header("Location: ht*p://yoursite.com/file.html");
header("Connection: close");
}
where file.html is what you get from file.php w/o parameters - if file.php was never supposed to end without parameters, replace the first two header lines in the last set of curly brackets with:
header("HTTP/1.0 404 Not Found");
Obviously, you only want to do this for the more important pages linked from other sites - your most important links. And links to your home page, if they don't include the index file (yoursite.com, and not yoursite.com/index.php) are all ok.
A lot of work if you don't know a little bit of php. If you do know a bit of php, you could probably also work things so the script figures the new url's out w/o having to do everything on a case-by-case basis.
[edited by: jatar_k at 6:59 pm (utc) on Sep. 17, 2004]
[edit reason] removed url [/edit]
Those are the pages I was thinking of. I think there is also a brief "note" that updates the Cool URIs page, but I can't find it. It's not on the main addressing page as near as I can tell
[w3.org...]
In any case, the Cool URIs page lays it out pretty well.
Tom
I've pointed my webmaster in the direction of this thread so I'll see what comes of that. At the moment one of our sites has been reverted back to .html and one is still .php. Maybe best to leave it like this and see which works best.
As for me? Head down into w3c, and keep on studying.
wouldn't change them, they are already indexed and your incoming links point to them.Never change pagenames or extensions unless absolutely necessary
I couldn't agree more. First off, Yahoo still doesn't handle 301's like they should. And when the filename is changed it's a whole new page, which happens to be identical to the other page, just with a different file extension. How long will it take brand new pages to show PR? They can both be in the index at the same time, depending on how current updates are.
I watched one site alone out there go URL only and drop to oblivion when changing file extensions - for the homepage from being in top 5 for ages for it's primary big money-making phrase, and several other pages also for key search terms. And it looks to be indefinite in duration at this point.