Forum Moderators: phranque

Message Too Old, No Replies

Dynamic into Static

PHP into HTML

         

TomekLawreszuk

10:03 pm on Feb 28, 2006 (gmt 0)

10+ Year Member



Hi,

I want to change my dynamic php site to static html site to improve ranking and pages interlinking, however I have few concerns regarding:
- my current pages have domain.com/item.htm?id=1222 extensions, the new html will not be the same
- after I'm finished with the new html design should I delete all old files from the server and upload new site? Wouldn't I loose my ranking?

Thanks,
Tom

celgins

10:19 pm on Feb 28, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Has some SEO-professional told you that HTML-based pages will rank higher than PHP-scripted pages?

In essence, the search engines only see static content, so the dynamic attributes of PHP don't really hurt your SERPs.

TomekLawreszuk

10:30 pm on Feb 28, 2006 (gmt 0)

10+ Year Member



How do I joint together static content with dynamic design? From my experience is a lot easier to get better ranking with static pages? Do you suggest to do rewrite mode? My pages do not interlink each other and that's the main problem.

Cheers,
Tom

Birdman

10:47 pm on Feb 28, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



If you only have one parameter(id=n), then there should be no problem at all. URLs like that are perfectly indexable and should perform just as well as an .html counterpart.

I use mod_rewrite to avoid any query string, but I do it when building the site. If you switch it up now you could be in for some trouble for awhile, until the engines get it figured out.

after I'm finished with the new html design should I delete all old files from the server and upload new site

That depends. Somehow, you need to send a 301(moved permanently) redirect to tell the engines(and humans!) that the file is elsewhere, permanently. You can do this with the PHP script(item.htm) or you can do it with .htaccess.

If it were me, I would keep the site dynamic(since it's so nice) structure, but make it appear static.

You could start naming you pages:

domain.com/item_1222.htm

Then, you can use mod_rewrite to send it to a script with the id appended but the user or bot don't see the new URL.

Example:

RewriteEngine On
#below rewrites the static URL to 'dynamic' and sends it to the proper script
RewriteRule ^item_(.*)\.htm$ /your_new_script.php?id=$1 [L]
#this one will catch the old style URLs and send 301
RewriteCond{REQUEST_URI} ^item.htm
RewriteCond{QUERY_STRING} ^id=(.*)
RewriteRule ^item_(.*)\.htm$ /your_new_script.php?id=%1 [L, R=301]

That's how I would approach it. The code may not be perfect, as will probably be pointed out later in this thread:) but it's a basic guideline.

Finally, like I said early in this long-winded post, I wouldn't even worry about one param like you have but here's an alternative. There are other methods as well.

Cheers,
Birdman

Birdman

10:53 pm on Feb 28, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



My pages do not interlink each other and that's the main problem.

You probably just need to re-examine your script. You can interlink with PHP/database logic and dynamic pages.

TomekLawreszuk

11:21 pm on Feb 28, 2006 (gmt 0)

10+ Year Member



Have you done anything like this before? What guarantees good subpages interlinking? I am afraid to loose my ranking.

Thanks a lot for your help,
Tom