I'm trying to use "Clean URLs" to make my future page look simple. For example, right now I'd like a "url.com/about/" section with the subsections "url.com/about/advertise/" and "url.com/about/contact/", etc. The actual URL would be http://url.com/?page=about&sub=advertise 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.
[b].htaccess[/b]
[code=php]
<FilesMatch "^about$">
ForceType application/x-httpd-php
</FilesMatch>
[/code]
[b]'about' file[/b]
[code=php]
<?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
}
}
?>
[/code]
Thanks for any help...