Mod rewrite, second parameter problems

Posted on 2008-02-12
Medium Priority
Last Modified: 2010-04-21
This is the url : http://www.cesa.org.za/minister.php?action=minister&data[groups]=1&data[letter]=F,G,H,I,J

mod rewrite is working, as the first variable is passed: http://www.cesa.org.za/ministers/1

But fails with this one: http://www.cesa.org.za/ministers/1/F,G,H,I,J
and I then get these php errors:
Warning: mysql_fetch_array()
Warning: Invalid argument supplied for foreach()
Options +FollowSymLinks
RewriteEngine on
RewriteRule churches/(.*) church.php?action=displaychurches&data[provinceid]=$1
RewriteRule churches/(.*)/ church.php?action=displaychurches&data[provinceid]=$1
RewriteRule education/(.*) education.php?action=displayeducation&data[educationtypeid]=$1
RewriteRule education/(.*)/ education.php?action=displayeducation&data[educationtypeid]=$1
RewriteRule ministers/(.*) minister.php?action=minister&data[groups]=$1
RewriteRule ministers/(.*)/(.*)	minister.php?action=minister&data[groups]=$1&data[letter]=$2

Open in new window

Question by:cybergary
LVL 43

Accepted Solution

ravenpl earned 500 total points
ID: 20874736
That's because always the first fires
(.*) matches anything, so second rule have no change to fire

RewriteRule ministers/([^/]+)/?$ minister.php?action=minister&data[groups]=$1
RewriteRule ministers/([^/]+)/([^/]+)/?$ minister.php?action=minister&data[groups]=$1&data[letter]=$2

Author Closing Comment

ID: 31430106
Thanks for the help and explanation

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

In my time as an SEO for the last 2 years and in the questions I have assisted with on here I have always seen the need to redirect from non-www urls to their www versions. For instance redirecting http://domain.com (http://domain.com) to http…
It is possible to boost certain documents at query time in Solr. Query time boosting can be a powerful resource for finding the most relevant and "best" content. Of course the more information you index, the more fields you will be able to use for y…
The video provides a quick and easy steps to migrate MBOX file to well known Outlook PST and Office 365. Besides this, it also supports and migrates more than 20 email clients of MBOX which include AppleMail, Opera, Thunderbird and SeaMonkey effortl…
Hi, this video explains a free download that you can incorporate into your Access databases, or use stand-alone for contact management. Contacts -- Names, Addresses, Phone Numbers, eMail Addresses, Websites, Lists, Projects, Notes, Attachments…
Suggested Courses

607 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question