Forum Moderators: open

Message Too Old, No Replies

Showing .php files as html

so we dont have to use question marks (?) and other stuff.

         

tunayilmaz

9:24 am on Nov 9, 2002 (gmt 0)



I get penalty this month, and we try to find out why it happenned. Too many people tells its because question mark. Actually I dont think so. Maybe google gives more ranking to html than php. I think i get penalty by another reason.

Finally i found a way to show my php files as html. I wanna ask will it help to get more ranking. Or it doesnt matter for google with or without question mark.

Thats the way how i made it:

I have thousands of hotels, thats why i am using php. They all stored in MySQL.

firstly I create a folder called "hotels". I have sent a .htaccess file. it includes this line (Only one line).

ErrorDocument 404 /hotels/

It means when a client request a non existing file under hotels directory, it will go directly to index.php in hotels folder.

eg. Requested file is like that: hilton_234.html

234 is hotel id in my database. index.php will find 234th hotel from database and it shows hilton hotels details.

What do you think guys, will it helps to get more ranking.

Thanks in advance

ciml

1:04 pm on Nov 9, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I think that penalty is the wrong word, but Google tends to crawl 'static' looking URLs more easily than 'dynamic' looking URLs with "?", "&" and "=" characters. Google now crawls 'dynamic' looking URLs much more eagerly than in the past, but if your PageRank is quite low then this could well be a problem.

"ErrorDocument 404 /hotels/" is not a good idea. Currently, Google will not index URLs that return a 404 error, and (unlike /robots.txt excluded URLs) Google will not even list 404 URLs in the results. The PageRank is still split by links to 404 pages, so links to other (non-404) pages will not get the PageRank that they would if the links to the 404 URLs weren't there.

Using .htaccess in Apache, "RewriteRule ^/somepath(.*) /otherpath$1" would seem a good answer to your problem; you may need a "RewriteEngine on" directive first. See Apache's documentation for mod_rewrite [httpd.apache.org].

Nick_W

1:22 pm on Nov 9, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Antother way to make you pages look static is this:

Create a file called 'hotels' with no extention and program it to go fetch your data based on the query string. For example, lets say you have 2 query vars $country and $hotel (I'll come back to this)

In your .htaccess write this. It will force apache to treat the hotels file as a php script.

<Files hotels>
ForceType application/x-httpd-php
</Files>

Now, back to your hotels file:
To grab the query files do something like this:

$path_info=explode("/", $_SERVER['PHP_SELF']);
$country=$path_info[1];
$hotel=$path_info[2];

// Do the rest of your page generation.

So you end up with urls like this.
www.site.com/hotels/denmark/somehotel

Hope that's clear, I've got a bit of a hangover this morning ;)

Nick

Grumpus

1:48 pm on Nov 9, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I suggest that starting several updates ago, Google tends to prefer dynamic pages (if they are formatted properly) over static pages. My pagerank has remained unchanged, my layout has remained unchanged, yet I've seen nearly a 500% increase in Google traffic over the past two updates.

G.

Dave2

11:24 pm on Nov 9, 2002 (gmt 0)

10+ Year Member



I like using a php file - we have one for each major section; the .php page itself, even though it has over 100 entries, gains pagerank for every entry on it - so all of our articles etc are at PR6, even if they've just been entered.
Had no problems with penalties...