Forum Moderators: phranque
I am new to Apache's mod_rewrite and php. I've tried my best to understand it, but I can't write the codes to suit my needs.
I am trying to make my urls more friendly, in which I have some url like:
/content.php?directory=dir1
/content.php?directory=dir1&page=pg1
How do I write the RewriteRule (and RewriteCond?) on my .htaccess which will function in this way:
both /dir1/ and /dir1 point to /content.php?directory=dir1
and
both /dir1/page1/ and /dir1/page1 point to /content.php?directory=dir1&page=pg1
and
/ (ie, [mydomain.com...] point to /content.php?directory=home
both dir1 and pg1 are variables.
I need some helps from you guys.
Thank you.
--
sipkhoon