logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Apache View previous topic :: View next topic
Reply to topic   Topic: URL Rewrite: Querysting
Author
tholian



Joined: 22 Apr 2015
Posts: 4
Location: Malaysia

PostPosted: Fri 25 Nov '16 2:44    Post subject: URL Rewrite: Querysting Reply with quote

Hello everyone,

i have problem I've been trying to address and so far i have not found a solution. The issue is this:

I have an URL like this:

http://www.tholian.com/Application/SignIn?X=1
http://www.tholian.com/Application/SignIn?O=2

Value of X determines the Options shown on the screen.

However, want the URL to be like this:

http://www.tholian.com/Application/SignIn/X/1

Can anyone guide me?

Regards,
Tholian
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7373
Location: Germany, Next to Hamburg

PostPosted: Sat 26 Nov '16 10:25    Post subject: Reply with quote

Code:
RewriteCond %{QUERY_STRING} ^(\w+)=(\w+)$
RewriteRule ^/Application/SignIn /Application/SignIn/%1/%2?


Note that this particular example will work only for a single var=val pair containing only letters, numbers, and the underscore character.
Back to top


Reply to topic   Topic: URL Rewrite: Querysting View previous topic :: View next topic
Post new topic   Forum Index -> Apache