GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Webmaster Q & Fuckin' A (https://gfy.com/forumdisplay.php?f=27)
-   -   Adding Dynamic PHP to a site with Static Pages (https://gfy.com/showthread.php?t=1008848)

choona 02-03-2011 06:38 PM

Adding Dynamic PHP to a site with Static Pages
 
I would like to add dynamic PHP pages to my site that is currently all static HTML pages.
I have a few concerns, primarily off page issues. I'm currently redesigning my site to update automatically.
Some problems might be:
  • 404 errors
  • Google penalties
  • Pages that are already indexed by search engines

How do I make my static HTML page dynamic PHP without screwing up my search engine results?

TheDoc 02-03-2011 08:41 PM

Does the dynamic php change have a query string or something?

Other than any changes to your site can change your rankings, going dynamic vs. static for automatic updates shouldn't hurt your rankings or give you a penalty.

With 404 errors and pages already in the index, you do 301 redirects. Or name the files the same .html files, in a .htaccess file add AddType application/x-httpd-php .html to get the html to execute the php.

301 redirect example for your .htaccess file
redirect 301 /path/of/old/file.html http://www.domain.com/full-new-path.php

You can also use Google Webmaster Tools, verify your site, and let Google tell you about any errors that you missed... easy way to make sure those important pages you may have missed get corrected.

Jakenavaro 02-04-2011 09:09 AM

try to validate first your html in w3c so you can see your html errors you need to validate also your css/xhtml.

robber 02-04-2011 10:05 AM

Quote:

Originally Posted by choona (Post 17891892)
I would like to add dynamic PHP pages to my site that is currently all static HTML pages.
I have a few concerns, primarily off page issues. I'm currently redesigning my site to update automatically.
Some problems might be:
  • 404 errors
  • Google penalties
  • Pages that are already indexed by search engines

How do I make my static HTML page dynamic PHP without screwing up my search engine results?

You should be able to achieve a working site that shouldn't change any links by utilising mod_rewrite within your .htaccess file. You will be able to design all your dynamic content and provide meaningful pages without too much hardwork, and your design can be easily amended or changed depending upon what you are wanting to achieve. If you redirect any old links to our new pages any page rank attached to the old pages should transfer over to the new ones. If you want to clarify anything or have, feel free to send me a message on icq, I'm happy to help.

HomerSimpson 02-04-2011 08:36 PM

you can also tell apache to parse .html file same as .php ones
this way you'll have .php files with html extension...

it's easy to do and to maintain in future...

Denny 02-04-2011 08:49 PM

Quote:

Originally Posted by HomerSimpson (Post 17894785)
you can also tell apache to parse .html file same as .php ones
this way you'll have .php files with html extension...

it's easy to do and to maintain in future...

yep, I did it like that way a few times.

Code:

AddType application/x-httpd-php .html
AddType application/x-httpd-php .htm


seoguyzzz 02-05-2011 08:35 AM

rewrite .php urls to .htm urls using .htaccess file
best if u cab get page titles in page url name.
thx

choona 02-10-2011 02:07 AM

Everyone thanks for the tips on parsing html as php.
I just tried it on my local machine thru Wamp Server.
I used this:
Code:

AddHandler application/x-httpd-php .html
Instead of adding this code to .htacces, I used httpd.conf

So it looks like I can use all the same file names.


All times are GMT -7. The time now is 03:19 PM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc