BaBazinga BaBazinga - 4 months ago 11
HTML Question

Set up proper URL directory structure for web pages

Many websites use the following format for different pages throughout the site.

For example:
http://www.state.nj.us/nj/

The about page URL is:
http://www.state.nj.us/nj/about/

Currently my about page URL is http://www.website.com/about.php

The URL looks much cleaner and better using the the folder structure website.com/about/

I just wanted to figure out whats the proper way web developers set this up for their website for other pages.

Do they really make a about folder in the root directory and use a index.php for the about page? So whenever they open the /about/ directory it automatically loads the index.php file for that particular page?

Thanks for any help just trying to use proper etiquette for my site

Answer

Not at all.. What we do is to use url rewriting... CHeck this

Feel free to comment if u need help ;)..Coz I have also worked it out in the previous week Create an .htaccess file in the dir you are working on and write:

RewriteEngine On
RewriteRule   ^about/?$   about.php  [NC]
RewriteRule   ^stories/?$   stories.php  [NC]