Using multiple query parameters with URL Rewriting

Hello,

Project properties

Server Model : PHP
Handler : Apache
Use Routing : ON
Auto Add Base : ON

How can I add multiple URL parameters to the route properties for URL Rewriting config.

Working example:

I can route with 1 Query Parameter using Routes;

Route -> ( this works very vell when I call this URL : http://localhost/folder1/folder2/model1 )
Name : Empty
Path : “/folder1/folder2/:model”
URL : “/folder1/folder2/index.php”
Method : ALL
Sensitive : unchecked
Strict : unchecked

What do I need is:

Route -> ( called URL : http://localhost/folder1/folder2/model1/section1 )
Name : Empty
Path : “/folder1/folder2/:model/:section” —>>>> (is the the correct usage of assigning multiple query parameters? )
URL : “/folder1/folder2/index.php”
Method : ALL
Sensitive : unchecked
Strict : unchecked

Thank you.

It’s not really clear in your post what you are having issues with. But you can have as many parameters in your route as you need.

1 Like

Hello Brad,

I tried several methods.

I have 2 routes.
1- /prog-profile/:programid
2- /prog-profile/:programid/:instanceid

I can route with 1 paramter is OK

I can not route with 2 parameters, keep getting ‘Forbidden’ - ’ You don’t have permission to access this
resource.’ from Apache server warning.

Note: All routes goes to the same page and my query parameters contains space characters %20

Do you have any idea how can I route without forbidden access?

Where do you get the error message?

How are you setting your parameters and are they being set? You seem them in the URL in browser?

I see the error in my browser directly while the link route to my page.
I am setting my parameters in my links like this:

1- /prog-profile/ID123 - works ok (routes back to /prog-profile/)
2- /prog-profile/ID123/1975%20-%201980 can not go to page gives error forbidden (also should route to /prog-profile/)

Yes I can see the parameters in the URL without any problems.

They shown like this:
– localhost/prog-profile/ID123/1975%20-%201980

Looks like you have special characters in your second parameter value. That is likely causing your issue.

Do you have a solution?

Avoid using spaces and special characters - always. You may have to rethink where you get the second value from. Where you getting the second value from and what is the actual value?

Oh, I just figure out you have spaces in your value. Is it suppose to be ‘1975 - 1980’? That not going to work.

Can I use session manager to store the values and rewrite the URL in the same page?

No, that won’t wrk. The URL is written before the page loads. You will have to figure out a way not to use spaces. Are you getting the second parameter from a database? IF so, change your data value to 1975-1980 with no spaces and it will probably work.