Just wanted to know if is possible to use mod_rewrite on a single(or more ) sub folder(s).
have a service in a folder that i would like to call like a rest service syntax .
$url = 'http://mysite/subfolder/parem1/parem2/parem3/';
$_SERVER['REQUEST_URI']
$tokens = explode('/', $url);
echo $tokens[sizeof($tokens)-2];
so the question is if I could catch all the different segments in a index.php in the subfolder, by using forexample modrewrite ( by placing a .htaccess with the rules only in this folder ? ) or how is it done ?
regards
It is possible. In your .htaccess, you could put something like this:
In your case you could just put the .htaccess file with the index.php in the folder where your service is located.
This way you can fetch (and sanitize) the
$_GETarray, instead of fetching the whole url.