Results 1 to 2 of 2
  1. #1

    Trying to get "Clean URLs" to work -

    I'm trying to use "Clean URLs" to make my future page look simple. For example, right now I'd like a "" section with the subsections "" and "", etc. The actual URL would be or contact, etc. I'm having a difficult time understanding how to do this using mod_rewrite. I don't understand what the ^ does and [a-z] or whatever and cannot do it on my own. Can anyone help me?

    I *DID* get it to work doing it with the ForceType method below, but as you can see it doesn't contain the ?page=about&sub=advertise that I can only do with mod_rewrite. Can someone make a small example for me or guide me through it? Thanks.

    ForceType code -- not what I want.

    PHP Code:
    <FilesMatch "^about$">     ForceType application/x-httpd-php </FilesMatch
    'about' file
    PHP Code:
    <?php $expl explode("/",$HTTP_SERVER_VARS["REQUEST_URI"]); $subsection $expl[2];     if ($expl[1] == "about")     {         if ($subsection == "advertise")         {             print "advertise subsection - e-mail us for information";         } elseif ($subsection == "contact")         {             print "contact form subsection - email us to contact us.";         } elseif ($subsection == "staff")         {             print "staff subsection - learn about us";         } else         {             ?>             welcome to our about section.  here you can find out about our: <a href="advertise/">advertising</a>,<a href="contact/">contact us</a>, or view our staff's <a href="staff/">information</a>             <?php         }     } ?>
    Thanks for any help...

  2. #2
    Join Date
    Apr 2003
    London, UK
    There's a nice thread below on this very subject

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts