Prestashop 1.7无法访问api

问题描述 投票:0回答:1

我无法访问我的prestashop测试商店的api。我在这做了什么:

Web服务处于活动状态,并创建密钥:

screen copy of my admin

重写mod在Apache上是活动的:

Apache rewrite mod is ACTIVE

htacess似乎应该是:

    # ~~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


#Domain: 192.168.1.20:8080
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/font-woff .woff
AddType application/font-woff2 .woff2
<IfModule mod_headers.c>
    <FilesMatch "\.(ttf|ttc|otf|eot|woff|woff2|svg)$">
        Header set 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

但无论如何,它不起作用:

it doesn't work....

网址很好:

url is fine

我尝试了两种方式连接:

localhost / api和http://mykey@localhost都让我到404。

编辑:Apache日志(错误和访问)不告诉它任何事情...编辑:我如何检查urlRewrite是否运行良好?

编辑2:好吧,网址Rewrite似乎根本不起作用。当我打开它时,几乎所有东西都不起作用......(无法获得任何产品的页面......)

谢谢你的帮助。泽维尔。

apache api ubuntu prestashop lamp
1个回答
1
投票

解决了 !这是一个Apache配置问题。

<Directory /prestashop/>
    Options Indexes FollowSymLinks MultiViews
    AllowOverride all <<<< all instead of none
    Order allow,deny
    allow from all
</Directory>

我必须通过AllowOverride all更改AllowOverride none。谢谢。

© www.soinside.com 2019 - 2024. All rights reserved.