php - REST htaccess redirect -
i'm developing php script uses rest api. request client goes
http://.../api/cart
i have directory api/cart/ , script index.php in it.
when client tries request http://.../api/cart
server redirects http://.../api/cart/
(which right, way) returns 300 response. need him receive "200 ok"
what should do? maybe write specific .htaccess?
this mod_negotiation thing, depends on other kind of stuff have in directories. here, mod_negotiation sees couple of things /api/cart
request can map to, , lets user-agent know. try messing multiviews and/or mod_dir (to prevent redirect). maybe in /api/
directory:
options -multiviews directoryslash off rewriteengine on rewritecond %{request_filename} -d rewriterule ^(.*[^/])$ /api/$1/ [l]
Comments
Post a Comment