Apache
  Home arrow Apache arrow Using ForceType For Nicer Page URLs
Dev Articles Forums 
ADO.NET  
Apache  
ASP  
ASP.NET  
C#  
C++  
ColdFusion  
COM/COM+  
Delphi-Kylix  
Design Usability  
Development Cycles  
DHTML  
Embedded Tools  
Flash  
Graphic Design  
HTML  
IIS  
Interviews  
Java  
JavaScript  
MySQL  
Oracle  
Photoshop  
PHP  
Reviews  
Ruby-on-Rails  
SQL  
SQL Server  
Style Sheets  
VB.Net  
Visual Basic  
Web Authoring  
Web Services  
Web Standards  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
APACHE

Using ForceType For Nicer Page URLs
By: Joe O'Donnell
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 36
    2002-06-05

    Table of Contents:
  • Using ForceType For Nicer Page URLs
  • Apache's ForceType directive
  • Implementing ForceType sensibly
  • The PHP script
  • Conclusion

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Using ForceType For Nicer Page URLs


    (Page 1 of 5 )

    Apache has features that allow us to setup easy to remember URL's for our web site's pages. In this article Joe shows us how easy it is to do with Apache and a little PHP.One of the things I love about the Apache web server software is that it's so flexible. Its configuration file, httpd.conf, allows you to setup dozens of options that change the way your web server works. My main like about Apache is that you can re-route different document types to different applications/scripting engines. Another thing that gives Apache so much power is its built-in URL look back feature and customisable re-write engine.

    By either editing Apache's httpd.conf file or by creating a .htaccess file, we can modify the way Apache works to a certain extent. Combine this with some PHP knowledge and we have the power to add some seriously flexibility to our web sites.

    In this article we're going to look at one way to use Apache and PHP to change "ugly" web page URL's into easier to remember, more logical ones. For example, instead of having to use this URL to read about a specific animal:

    http://www.mysite.com/animals.php?animalId=5&color=red

    ... we can use Apache and PHP to setup a page with the following URL:

    http://www.mysite.com/animals/pig/red

    As I'm sure you'll agree, the latter URL is easier to read and remember. Setting up URL's like this also helps the search engines do their thing and stops certain search engines from rejecting your pages.

    To get the most from this article you should have Apache 1.39+ and PHP 4.1+ installed on a web server. I will assume that you're using Linux, but you could just as easily use Windows, Unix, etc.

    More Apache Articles
    More By Joe O'Donnell


       · This is a great article and will help me to create friendly url's that are so needed...
     

    APACHE ARTICLES

    - Programmatically Manipulating Microsoft Exce...
    - Installing PHP under Windows
    - Compressing Web Content with mod_gzip and mo...
    - Compressing Web Output Using mod_deflate and...
    - Setting Up Apache 2.0.45 to Parse PHP Pages
    - Custom Error 404 Documents with PHP
    - Using Apache and PHP on Mac OS X
    - ASP: Active Sessions, Active Logins and Tota...
    - Working With Oracle on Windows: Part 1
    - The Quick-n-Dirty Guide to Setting Up Apache...
    - Installing Apache With SSL: The Complete Gui...
    - 7 Powerful .htaccess Customization Tips
    - Trap And Get Notified: A Practical Solution ...
    - One Way To Use Server Side Includes
    - Using ForceType For Nicer Page URLs







    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway
    Stay green...Green IT