![]() |
PHP - Best way to make an HTML version of PHP pages?
So we have this dilemma. We want the search engines to see our individual review pages, and we don't think the spiders are all reaching them. I don't really know the best way to make sure this is happening, I'd like to customize each review page with keywords, titles, etc..
The only way I can think of without getting a dedicated server to do that empty directory trick, is to make a simple link list in an basic HTML page for the spiders.. Then links to a static copy of the reviews in HTML format.. If the user clicked anything they'd see the PHP, and most of the times our reviews remain static, unless a user posts a comment or a rating.. Sooo, we could do it once manually, but we'd like to do it regularly to keep the HTML pages updated with a more current version from our PHP driven pages.. Is that too fuckin ass backwards to even attempt? is there some kind of program that would parse the HTML including SQL queries and save it in a static HTML document? ;) Ass. Backwards. Socks |
well im not a pro when it comes to SE's, but can't you use htacess to make the .html files parsed as php, then you will be able to make the the files look like html while they are actually php....
|
Just put this in your .htaccess file in the root folder of your domain.
AddType application/x-httpd-php html AddType application/x-httpd-php htm That way it will parse all your .htm & html with php and you don't have to have .php any longer :) Tim :Graucho |
The problem is not the .php extension but many spiders don't
like the variables behind it. review.php?var=blah&var2=blahblah You wrap the php in a script that will create virtual directories so the example above looks like: /review/blah/blahblah this solves the search engine issues.....I'll see if I have that code lying around somewhere... DynaMite |
Use modrewrite to rewrite the URL's
or modify the scripts to use $PATH_INFO like dmoz does. |
Using the dir structure url will create a 404 so in the head of the script you gota place header("HTTP/1.1 200 OK");
Then take each of the paths and explode them by / for PATH_INFO to work. The make each / into an array and give it a var name. $var_array = explode("/",$PATH_INFO); $shit=$var_array[1]; Just echo the $shit and boom it works. TheDoc http://www.largecash.com |
Quote:
Thanks for all your help with this, Socks |
The above takes
http://www.domain.com/script.php?sex=yes&hot=no and changes it to http://www.domain.com/script/yes/no TheDoc http://www.largecash.com |
I wondered about that one too. I double-checked my logs and I didn't get a 404 for them. They were 200's.
|
We just don't understand what....
Using the dir structure url will create a 404 so in the head of the script you gota place header("HTTP/1.1 200 OK"); that does specifically.. We understand the concept of changing the PHP to directories but don't get that top piece of code or what it's there for.. |
Just try it without this...
header("HTTP/1.1 200 OK"); If it works then no worries, if it doesnt then place it in :) If I remember correctly unless their is an error return ok and run the script or some shit. IE if their is an error 404 it will return 200 ok and proceed to the script. Or some shit like that. Ofcourse I could be wrong :) TheDoc http://www.largecash.com |
HTTP/1.1 means ?I too speak HTTP version 1.1?. The important bit, once more, is the bit on the same line with this that says 200 OK. This is an HTTP response, and in this case it means ?I understood your request and managed to fulfill it.? Users usually don't see responses, but there is one noteable exception: If you've been browsing the Web for some time, you might have come across a page that reads ?HTTP 404 Not Found? and then goes on to explain that the document you requested could not be found on the server; 404 is the HTTP response code that means exactly what it says, that the requested document was not found, just like 200 is the HTTP response code that says that everything went fine. There are a whole bunch of different responses defined in HTTP, but 200 is by far the most common and useful one.
TheDoc |
Quote:
how does that work. so you direct that(/script/yes/no) with a 404 to the main page? |
That isnt easy for me to explain.
What it does is works like this....If you have a linking code to say a paysite. IE: http://www.domain.com/script.php?acc...0&site=massive We know that the first var comming in is accountid and the second is the site. So in the php of the script.php file I place in my arrays to split them in that order. Array 0 is the script.php Array 1 is the account id Array 2 is the site Example: $var_array[0] = "script.php"; $accountid=$var_array[1]; $site=$var_array[2]; Now in apache (I cant remember the setting name) but you have to be able to set it up so if you type in something like: domain.com/script and the dir script is not found it will look for a file called script in alpha order. So by doing so it breaks down a url to a directory url. http://www.domain.com/script/0000/massive the dir script is really script.php 0000 is the account id massive is the site Drawbacks are you have to put full paths to images and other links or at least ../../blah.html ect cause the images/dir structure of the html will be script/0000/massive Hope that help clears it up some. TheDoc http://www.largecash.com |
Great explanation, thanks for continuing to help out with this, we're implementing that now and we'll see how it works. The next question remains - any hosts that allow you to change the apache configuration without buying a dedicated server? :)
|
thanks for clearing that up :thumbsup
_ |
Quote:
48690894 |
All times are GMT -7. The time now is 12:19 PM. |
Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123