Problem URL webservices Prestashop

1

I am trying to make use of the prestashop webservice to make a complete order. I have developed a module and I have successfully tested it in a locally installed store.

I have the problem when implementing the same module in the real store. I have activated the web services, generated the api key and marked to perform the tests the boxes corresponding to customers. Ok, then to make a simple query in this way http://www.midominio.com/api/customers the web is redirected to the frontpage of the store.

I have checked the .htaccess and activated rewrite_rules in apache and nothing, I can not get an XML file back.

I leave here the configuration of my .htaccess :

# ~~start~~ Do not remove this comment, Prestashop will keep automatically the code outside this comment when .htaccess will be generated again
# .htaccess automaticaly generated by PrestaShop e-commerce open-source solution
# http://www.prestashop.com - http://www.prestashop.com/forums

<IfModule mod_rewrite.c>
    <IfModule mod_env.c>
        SetEnv HTTP_MOD_REWRITE On
    </IfModule>
RewriteEngine on
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] 

#Domain: www.mydomain.com
RewriteRule . - [E=REWRITEBASE:/]
RewriteRule ^api$ api/ [L]

RewriteRule ^api/(.*)$ %{ENV:REWRITEBASE}webservice/dispatcher.php?url=$1 [QSA,L]

# AlphaImageLoader for IE and fancybox
RewriteRule ^images_ie/?([^/]+)\.(jpe?g|png|gif)$ js/jquery/plugins/fancybox/images/$1.$2 [L]
</IfModule>

AddType application/vnd.ms-fontobject .eot
AddType font/ttf .ttf
AddType font/otf .otf
AddType application/x-font-woff .woff
<IfModule mod_headers.c>
    <FilesMatch "\.(ttf|ttc|otf|eot|woff|svg)$">
        Header add Access-Control-Allow-Origin "*"
    </FilesMatch>
</IfModule>

#If rewrite mod isn't enabled
ErrorDocument 404 /index.php?controller=404

# ~~end~~ Do not remove this comment, Prestashop will keep automatically the code outside this comment when .htaccess will be generated again
    
asked by Makros 19.04.2017 в 08:31
source

1 answer

5

Ok, problem found. The web worked from behind with a Nginx that had a rule location in the configuration file that redirected all the URLs (including / api / whatever) to the index.php.

Thank you all. Subject closed.

    
answered by 19.04.2017 / 09:23
source