Forum Moderators: phranque

Message Too Old, No Replies

question on approach to website

question on approach to website

         

drooh

7:21 pm on Sep 4, 2008 (gmt 0)

10+ Year Member



I use html, css, php & mysql to build websites.

As of now I have been building the site using a single index.php file that serves as a template or foundation for the site. The links for the navigation pass a variable that is retrieved by using the &_GET['page'] method and then quering the database for content. This method has worked well for me.

I have noticed some sites using directories for the location of pages. I am wondering what the benefit of this is? I know that from a marketing standpoint its nice to direct people to a website and then say slash whatever, such as www.websitename.com/promo. In this approach I can see that alot of coders are using a forward slash right before the name of the directory in their links (this preserves the heierachy of the site and Im assuming allows for the use of a single page template). But my question is, what is residing inside those directories? Im assuming there is an index file of some sort, but what are the contents of that file? Is it using a include to the path of the main template file?

So for example here is a site tree

website/index.php
website/about/index.php
website/contact/index.php
website/our_products/index.php
website/includes/template.php
website/includes/main.css

So do all the index.php files point to the template.php file? What is the content of those index.php files?

Just looking for comments

StoutFiles

7:48 pm on Sep 4, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



They are rewriting the URL's with their .htaccess file.

Example:

http://www.example.com/products.php?product=towel
becomes
http://www.example.com/products/towel

Look up .htaccess rewrites to find the solution; there are a lot of great examples on this site.

drooh

9:27 pm on Sep 4, 2008 (gmt 0)

10+ Year Member



thanks for the tip, so what are the main reasons for doing this? Just to make it look clean?

StoutFiles

11:41 pm on Sep 4, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Easier for search engines, looks better, etc.

phranque

12:10 am on Sep 5, 2008 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



getting a keyword into the url...