Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

From .HTM to .PHP website - What to do with S.E.

Status
Not open for further replies.

mickth

Technical User
Jun 5, 2004
35
US
Hello,
I've recently converted my site from normal .HTM pages to .PHP pages. My site has been active for about 1 year with .HTM pages, so most of my pages (the .HTM versions) are in various Search Engines. My question is, how do I get the Search Engines to start working with my .PHP pages. Do I:

A) Just delete all of my .HTM pages, and let the S.E. gradually notice my .PHP page?

B) Do I Keep the .HTM pages, but convert them to some kind of re-direct page?

C) Do I keep both versions of them, but make the links in the .HTM page link to the equivilant .PHP page?

D) Something I'm not thinking of? Hopefully better than A, B or C?

Help?

-Mick-

 
What you have to consider here, is what you mentioned:
google, amongst other, has cached your pages!

If you simply delete them, you will suffer.
If you duplicate your content, you will suffer.

If you use meta-refresh, you will suffer (pagerank).

I think the best option here, is to make your server also run .html files as php files.. (can be set up), then you put header location in the files, where they point to the equalivent php page.

If you want to do it the easy way, you can make a link:
<a href="path/to/new/page.php?id=foo&title=bar" title="Click here to view the requested page">page has moved here.</a>

If you are to use meta-refresh, have a high timeout! or your pagerank will suffer.

You can also define custom 404 in the .htaccess and in that way, also link the 404's to the index.php file.

Olav Alexander Mjelde
Admin & Webmaster
 
Thank you. I didn't even know what you talked about was possible. Back to the old books I guess........ :)

-Mick-
 
I think the simplest solution is to use mod_rewrite (if you're running apache) to make the server get an .php file for any .html requested.

The 404 error page still gives search engines the 404 error and will hurt your PR, though I sometimes still use it.
 
Hi Eric,
Thanks. Would the mod-rewrite swap a PHP for an HTM file if there were an existing HTM file? In some cases I am still using HTM files. I suppose I could swap them over to PHP also if I had to. Where I'm not using INCLUDE for headers and footers, I'm using HTM files.

-Mick-
 
No, you can't make it check that the file exists before it does the rewrite.
 
Hello,
No, I first tried insert some PHP code into an .HTM file, and it didn't work. Should I have tried an .HTML extension instead of an .HTM extension? For this site, I'm pretty much only using some INCLUDE statements. I'm not using it to work with MYSQL or anything. For the most part, I'm a believer in 'no-frills' kind of sites. Is there a way to make PHP work in normal HTM or HTML pages?

-Mick-
 
You need to change the config of your web server to send .html pages through the php processor. What server are you using?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top