Apache Lounge



Forum Index Downloads Search Register Log in  RSS Apache Lounge

Keep Server Online

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



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

Thank You! Steffen

Apache Lounge is not sponsored.

Your donations will help to keep this site alive and well, and continuing building binaries.

mod_rewrite condition

Post new topic   Reply to topic    Apache Forum Index -> Apache

View previous topic :: View next topic  
Author Message

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

it should be converted/redirected as

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

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

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

not tested, but this should do it

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

Post new topic   Reply to topic    Apache Forum Index -> Apache
Page 1 of 1