简体   繁体   English

Slim框架适用于http,但不适用于https

[英]Slim framework works on http but not https

I have a wordpress site running which is set to use HTTPS, Within the wordpress site I have a widget in a theme that is using the Slim framework. 我有一个wordpress网站正在运行,该网站设置为使用HTTPS。在wordpress网站内,我有一个使用Slim框架的主题小部件。 When running on HTTP it does work well but with HTTPS I do get 404 error. 在HTTP上运行时,效果很好,但在HTTPS上却收到404错误。 The ajax calls are initiated from the browser and request sources that are on the same domain. Ajax调用从浏览器启动,并请求位于同一域中的源。

Browser log says: No 'Access-Control-Allow-Origin' header is present on the requested resource. 浏览器日志中说:所请求的资源上没有“ Access-Control-Allow-Origin”标头。 Origin ' http://xxxxxxxx.xxx ' is therefore not allowed access. 因此,不允许访问来源' http://xxxxxxxx.xxx '。 The response had HTTP status code 404. 响应的HTTP状态码为404。

Within the app only relative path is used. 在应用程序内,仅使用相对路径。 Within the html source I see some HTTP requests for images etc. but it doesn't complain about them 在html源代码中,我看到了一些对图像等的HTTP请求,但它没有抱怨它们

对于您的Ajax网址,请确保它们以https://开头,或者只是//

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM