apache - Prestashop 1.7 无法访问 api

标签 apache api ubuntu prestashop lamp

我无法访问我的 prestashop 测试商店上的 api。
这是我所做的:

网络服务处于事件状态并创建了一个 key :

screen copy of my admin

rewrite 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

我尝试了两种连接方式:

本地主机/api & http://mykey@localhost两者都让我进入404。

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

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

谢谢你帮助我。
泽维尔。

最佳答案

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

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

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

关于apache - Prestashop 1.7 无法访问 api,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55285288/

相关文章:

apache - SEO 中的 301 或 302 重定向影响

apache - Kubernetes Ingress 路径找不到资源

apache - 在 TOMCAT 7 上安装 Apache Archiva 作为 Web 应用程序

php - 如何使用 PHP API 和 AngularJS 2 服务正确处理/获取正确的 JSON 响应?

javascript - Highcharts 不跟踪填充区域下的鼠标事件

ubuntu - imagemagick 构建每 A4 页两张图像的文档

python - 在 jupyter notebook 的单元格中使用 sudo

ubuntu - 在 VPS 服务器上安装 Kubernetes

apache - .htaccess url 从 http 重写为 https

javascript - 我的 RESTful API 未更新数据库,但 ajax 返回成功