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: mod_rewrite condition
Author
gskgouse



Joined: 19 Jun 2017
Posts: 1
Location: India

PostPosted: Mon 19 Jun '17 14:45    Post subject: mod_rewrite condition Reply with quote

Hi all,

I am using Apache server 2.4 on windows server 2012. Using Apache's Mod_Rewrite Rules I would like to change/redirect the URL given by user.
Following is my requirement:

when the user types the URL http://192.168.2.54/cgi-bin/ows/project1?service=wms&request=getcapabilities

it should be converted/redirected as http://192.168.2.54/cgi-bin/myservice.exe?project=project1&service=wms&request=getcapabilities

in short ows will be replaced with myservice.exe? and project1 will be replaced with project=project1.
Back to top
James Blond
Moderator


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

PostPosted: Wed 28 Jun '17 17:32    Post subject: Reply with quote

not tested, but this should do it

Code:
RewriteEngine on
RewriteRule ^/cgi-bin/ows/(.*)\?service=wms&request=getcapabilities$ /cgi-bin/myservice.exe?project=$1&service=wms&request=getcapabilities
Back to top


Reply to topic   Topic: mod_rewrite condition View previous topic :: View next topic
Post new topic   Forum Index -> Apache