2

My VHOST currently looks like:

<VirtualHost *:80>
     DocumentRoot /data/sites/example_deploy
     ServerName deploy.example.co.uk
     <Directory "/data/sites/example_deploy">
        Options +SymLinksIfOwnerMatch
        AllowOverride All
        Order allow,deny
        Allow from all

        AuthUserFile /data/confs/svn/htpasswd
        AuthName "Example deployment example testing"
        AuthType Basic
        Require valid-user
    </Directory>
</VirtualHost>

We have a URL /api that takes different parameters. Examples are:

  • /api/testing-bot-response/1234842823
  • /api/sql-deploy-response/stage/172bUd7s

What we are trying to achieve is that /api/* would not require a valid user and the HTaccess is satisfied before the request is made. The URL may be made up of more than 2 parameters.

I've researched the subject and have worked out that I need to use LocationMatch and pass the Satisfy parameter, however I am not sure how the regular expression should be formed.

slm
  • 15,396
  • 12
  • 109
  • 124
HGSSO
  • 55
  • 1
  • 8
  • 1
    I've resolved this issue. The trick is to use LocationMatch no location. $ order allow,deny allow from all Satisfy any – HGSSO Apr 17 '12 at 15:09
  • 1
    Then you should post the above comment as an answer and accept it... otherwise people (like me) will try to answer your question – Paolo Stefan Sep 12 '12 at 09:18

1 Answers1

0

I've resolved this issue. The trick is to use LocationMatch. Look at the below code:

$<LocationMatch "/api/*"> 
    order allow,deny 
    allow from all 
    Satisfy any 
</LocationMatch>
veben
  • 19,637
  • 14
  • 60
  • 80
HGSSO
  • 55
  • 1
  • 8