The way to change the url of your webpage and still load the correct page in the browser is by using the mod_rewrite functionality of Apache.

If your website is running on IIS I am afraid I must dissapoint you. The functionality presented on this website will not work for you.

The mod_rewrite rule that is included in this functionality will detect rewritten url's only when they are not existing directories and do not include a "/" or a "."

This allows images from the media directory and links to full pages not to be rewritten and served in the normal "oldfashioned" way.

Any url that is requested with just one word (or multiple words properly URLencoded) will be relayed to a single page with the found word(s) added as a parameter.

Example:

Your webserver gets a request for

www.mywebsite.com/contact

The mod_rewrite detects the word "contact" and redirects the incoming request to the page

www.mywebsite.com/short.php?page=contact

The short.php script now only has to locate the contact page and serve that to the requesting browser.

Continue reading >>