Forum Moderators: bakedjake

Message Too Old, No Replies

Is there a good way to organize your site?

First timer building a dynamic stie

         

mipapage

12:39 pm on May 22, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Background
I am building a site with four main areas, lets call them A-D. Each of those areas has, for simplicities sake, 4 pages:

a1,a2,a3,a4...b1,b2,b3,b4 and so on.

You can imagine what the Url looks like:
...com/mysite.php?page=a1

Which I have rewritten to:
...com/a1.html or ....com/a1/


Question:
Can I put those into subfolders on the server, and if so, what happens then to my Rewrite Rule which looks like:
RewriteEngine on
RewriteRule ^(.*)\.html$ /mysite.php?page=$1 [L]

What I do know is that if I put this:
RewriteEngine on
RewriteRule ^.*/(.*)\.html$ /mysite.php?page=$1 [L]

It will just look in the root directory, thereby defeating the purpose...


Is there a proper way to do this, or something that I am missing here?

Birdman

12:50 pm on May 23, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



>>or something that I am missing here?

I think you are missing the point a bit. If you want to actually create the directory tree and have the files reside in them, you are basically building a static site and don't need mod_rewrite.

The purpose of the dynamic site is to be able to keep all your data in one centralized area(typically a database) and then extract the data out according to the variable in the script. This way, your site seems to have separate folders when, in reality, it doesn't.

Do you have MySQL available to you? If so, I recommend using it to store your data.

Please feel free to ask more questions! I'm heading out of town for the weekend but there are many dynamic website gurus around here(me not one of them ;) ).

Birdman

mipapage

4:45 pm on May 23, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Birdman,
Thanks for the response. I do have it available to me - and have a great weekend!

The purpose of the dynamic site is to be able to keep all your data in one centralized area(typically a database) and then extract the data out according to the variable in the script. This way, your site seems to have separate folders when, in reality, it doesn't.

There's the php/mysql newbie in me showing through. I thought that was the case (the db), but, alas, I am only using one include for my current site - one variable, so I suppose that means one 'directory'.

Are there any primers that you (or anyone) can point me to on building 'your first simple db site'? <wine>It's been a long week, I've filtered a lot of coffee, and I have searched about this topic - problem is that I wasn't sure what to search for - I guess now I sorta know.<wine />


Nick_W had pointed me to a template engine (got it bookmarked 'somewhere', can't remember the name) which is great, but I was hoping to suffer through making my own first ;-]