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

Popular posts from this blog

html - Sizing a high-res image (~8MB) to display entirely in a small div (circular, diameter 100px) -

java - IntelliJ - No such instance method -

identifier - Is it possible for an html5 document to have two ids? -