? about web site layout

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
I would like my site to by as search engine friendly as possible. I made
up a main template for my website that all pages will be using. Here are
my two choices on how to layout the website. Which one is more search
engine friendly?? any tips are welcome too.

Method A) I make my main template and call it "domain.com/index.php" if i
want to go to another page it would all be pulled up through that same
file. ie: index.php?page=about  or index.php?page=articles. Using this
method makes it far easier to make changes to the template as I go. I
change a single file, and it effects every page. My fear is that search
engines will see this as just one page, and not a bunch of seperate pages.

Method B) For every page (about.php or services.php) I make a copy of
template, and make changes accordingly. The only way that I can see to be
able to update all pages dynamically is to keep most of the "template"
html in external files. and have each page look like the following:
<? php include ("html/top.htm"); ?>
<? php include ("html/bottom.htm"); ?>
my actual page would require about 8 of these includes. This method would
solve my search engine fear from method A, and keep the maintainance
pretty low, but all those includes make me worry about performance.


Re: ? about web site layout

Quoted text here. Click to load it

why not get a combination of both. Do you use Apache as your webserver? Can
you use mod_rewrite on it?
If so, you could have method b) to the outside, using about.php and have
method a) on the inside, so that your script runs as index.php?page=about.
The idea is to rewrite the request (well, it's done by an additional
internal request, but that shouldn't get you into trouble with performance).

Re: ? about web site layout

On Fri, 02 Jul 2004 10:24:10 +0200, Jan Harders wrote:

Quoted text here. Click to load it

ah yes, good all mod_rewrite. im not sure why i didn't think of that.
Luckily, the site is run a my own server so I will probably end up doing
exactly that. So for this instance that is the perfect solution. However,
just for future reference, in the case that I did not have access to that,
what would be the best solution?

Thanks again!

Re: ? about web site layout

I just answered my own question.
just for kicks i tried making a ".htaccess" file with the following

RewriteEngine on
RewriteRule search  http://www.google.com

then popped open mydomain.com/search, and sure enough it brought me right


Re: ? about web site layout

Quoted text here. Click to load it

Yeah, but that would be an external redirect (one where your server tells
the client to go and make another request to the other url - not very
internal would be like

RewriteCond % !^/index.php
RewriteCond % /(.*)\.php$
RewriteRule .?^ index.php?page=%1 [L]

which is untested, of course ;)
first line makes sure that we aren't running into a loop by rewrting
index.php to index.php.
second one matched all requests that are /*.php (the $ at the end is just
like in perl-regexps, end of string, like that so you can always use *.php4
et al, that won't be rewritten).
and the RewriteRule than rewrites the whole thing.

Re: ? about web site layout

I futsed around with rewrite for a bit. most of which was unsuccessful.

anyway, here is what I finally came up with. which works just as I would

RewriteEngine on
RewriteBase /
RewriteRule ^(.*)\.htm$ index.php?page=$1


Site Timeline