Basically I am trying to have articles/category/article.php to pump to another file as indicated with the rewrite below.
RewriteRule articles/(.*)/(.*).php /articles.php?cat=$1&article=$2
The problem is that I still want a request that i would ideally like that also requests where only category is given, but no article id, also are handled by the script. It would be great if there is a way to do this in the .htaccess, but otherwise. Could someone recommend how I would do it using PHP? I mean, I could probably somehow make the .htaccess point every articles* request to the articles.php, right?
.htaccess problem with non-full-path requests
Moderator: General Moderators
- Kieran Huggins
- DevNet Master
- Posts: 3635
- Joined: Wed Dec 06, 2006 4:14 pm
- Location: Toronto, Canada
- Contact:
not sure exactly what you're after here, but I think you just need another rewrite rule:
Code: Select all
RewriteRule articles/(.*?)/? /articles.php?cat=$1