首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Prestashop 404服务错误404

Prestashop 404服务错误404
EN

Stack Overflow用户
提问于 2016-10-17 18:18:56
回答 2查看 2K关注 0票数 0

我正在尝试从脚本运行with服务到prestashop (给出的示例与客户列表)。我收到以下错误:

代码语言:javascript
复制
HTTP REQUEST HEADER
GET //api/customers&ws_key=57IGC8CC1HPC58U865KP7YNPWK1G4LSC HTTP/1.1
Authorization: Basic NTdJR0M4Q0MxSFBDNThVODY1S1A3WU5QV0sxRzRMU0M6
Host: edentalbook.com
Accept: */*

HTTP RESPONSE HEADER
HTTP/1.1 404 Not Found
Date: Mon, 17 Oct 2016 10:11:08 GMT
Server: Apache
Access-Control-Max-Age: 1000
Access-Control-Allow-Headers: X-Requested-With, Content-Type, Origin, Authorization, Accept, Client-Security-Token, Accept-Encoding
Access-Control-Allow-Credentials: true
Access-Control-Allow-Methods: POST, GET, OPTIONS, DELETE, PUT
Content-Length: 320
Content-Type: text/html; charset=iso-8859-1
RETURN HTTP BODY
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>404 Not Found</title>
</head><body>
<h1>Not Found</h1>
<p>The requested URL /api/customers&amp;ws_key=57IGC8CC1HPC58U865KP7YNPWK1G4LSC was not found on this server.</p>
<hr>
<address>Apache Server at edentalbook.com Port 80</address>
</body></html>
Bad ID

我测试了服务器(我安装了一个新的prestashop),并且工作正常。因此,我假设这是一个prestashop配置问题。我还启用了友好的urls,htaccess

有什么想法吗?谢谢

编辑:可能是url重写问题,因为如果我从服务器转到http://edentalbook.com/webservice/dispatcher.php工作正常,我会附加htaccess文件

代码语言:javascript
复制
# ~~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
RewriteCond %{HTTP:Authorization} ^(.*)
RewriteRule . - [E=HTTP_AUTHORIZATION:%1]



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

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

# Images
RewriteRule ^([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$1$2$3.jpg [L]
RewriteRule ^([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$1$2$3$4.jpg [L]
RewriteRule ^([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$1$2$3$4$5.jpg [L]
RewriteRule ^([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$1$2$3$4$5$6.jpg [L]
RewriteRule ^([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$5/$1$2$3$4$5$6$7.jpg [L]
RewriteRule ^([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$5/$6/$1$2$3$4$5$6$7$8.jpg [L]
RewriteRule ^([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$5/$6/$7/$1$2$3$4$5$6$7$8$9.jpg [L]
RewriteRule ^([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$5/$6/$7/$8/$1$2$3$4$5$6$7$8$9$10.jpg [L]
RewriteRule ^c/([0-9]+)(\-[\.*_a-zA-Z0-9-]*)(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/c/$1$2$3.jpg [L]
RewriteRule ^c/([a-zA-Z_-]+)(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/c/$1$2.jpg [L]
# AlphaImageLoader for IE and fancybox
RewriteRule ^images_ie/?([^/]+)\.(jpe?g|png|gif)$ js/jquery/plugins/fancybox/images/$1.$2 [L]

# Dispatcher
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ %{ENV:REWRITEBASE}index.php [NC,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
EN

回答 2

Stack Overflow用户

发布于 2020-06-29 21:18:58

转到BackOffice ->商店参数->流量和搜索引擎优化,并点击‘设置商店网址’区块中的保存按钮。这将重新生成.htaccess

票数 1
EN

Stack Overflow用户

发布于 2017-11-28 01:41:38

这可能是权限问题。

检查如果您使用suPHP,您可以通过检查错误日志来检查您是否有权限问题(它将抛出SoftException)

如果是,则文件夹必须为755,文件必须为644

因此,如果您拥有SSH访问权限,则可以使用find命令轻松修复。

首先转到PrestaShop安装所在的路径。然后:

文件的

find . -type f -perm 666 -exec chmod 644 {} \;

文件夹的

find . -type d -perm 777 -exec chmod 755 {} \;

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/40083811

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档