views:

10

answers:

1

Hi,

I am trying to match a URL like: http://xy.com/test/abcd to a php script named test.php

Here is my .htaccess

RewriteEngine on
RewriteBase /
RewriteRule ^test.* test.php [L]

This matches fine when I make a request with curl like:

curl http://xy.com/test123

But it the rule does not seem to match the following call (getting a http not found)

curl http://xy.com/test/1234

The latter case is what I want to implement a RESTful API. How do I have to define my rule to match this?

A: 

Not sure, but I think your rule in the second example tries to find /test/test.php

Try this:

RewriteEngine on
RewriteBase /
RewriteRule ^test.* /test.php [L]
Litso
Does not work. In this case both curl calls fail.
Matt