Im new to creating 'search engine freindly' urls. I am trying to implement the .htaccess method:
<FILES article>
ForceType application/x-httpd-php
</FILES>
I have a link like so: http://www.mysite.com/test/rewrite/article/3/0
Breakdown:
"test" is a directory not a file.
"rewrite" is also a directory not a file.
"article" should be parsed as php.
and '3' and '0' are the values of some parameters.
How do I parse this so it knows to go into directory 'test' then directory 'rewrite' then call article.php and pass the values?
Right now it seems to think that 'test' and 'rewrite' are also values to be passed and not directories. I think....
I guess Im confused as to how to drill down into directories using this method...
My structure:
- rewrite.php lives in the 'test' directory
- article (with no extension) lives in the 'rewrite' directory
- .htaccess also lives in the 'rewrite' directory
Hope this makes sense, any direction would be great!
Thanks in advance
mod rewrite and urls
Moderator: General Moderators
- Kieran Huggins
- DevNet Master
- Posts: 3635
- Joined: Wed Dec 06, 2006 4:14 pm
- Location: Toronto, Canada
- Contact:
- aaronhall
- DevNet Resident
- Posts: 1040
- Joined: Tue Aug 13, 2002 5:10 pm
- Location: Back in Phoenix, missing the microbrews
- Contact:
What I would do is have mod_rewrite direct to a single file for all requests, typically in the root directory, parse the request URI, and include the necessary files for the request. This tutorial covers how to accomplish it.