I am using WP REST API in my wordpress blog. I am getting all the post using this link and it works fine. http://www.gmonetix.com/blog/wp-json/wp/v2/posts
But when I want to get a particular post by id such as http://www.gmonetix.com/blog/wp-json/wp/v2/posts/1122 , it shows 403: Error - access to the resource in this server is denied. Please give a solution for it.
You can retrieve single post by id like, this should work,
http://demo.wp-api.org/wp-json/wp/v2/posts/?filter[p]=1122
This URL gives response,
http://www.gmonetix.com/blog/wp-json/wp/v2/posts/?filter[p]=1122
I had the same issue. You can try disabling mod_security on your server or making an exception for mod_security for the REST endpoints. Also you can try WordPress on your local server and confirm issue.
Related
I am using Guzzle to pull data from content that the end location of a google rss feed link. e.g.
https://news.google.com/rss/articles/CBMiVWh0dHBzOi8vd3d3LmxvbmRvbi1maXJlLmdvdi51ay9pbmNpZGVudHMvMjAyMy9qYW51YXJ5L21haXNvbmV0dGUtZmlyZS1zdHJlYXRoYW0taGlsbC_SAQA?oc=5
When using curl with -L (location) flag it appears to bypass the consent redirect and pulls through the end location content.
I am using Drupal 10 with httpclient available which I understand uses Guzzle 7. How do I do the same there?
When enabling 'track redirects' guzzle feature I can see it appears to be getting stuck redirecting to google consent page and not redirecting to the end location?
e.g.
An AJAX HTTP error occurred. HTTP Result Code: 200 Debugging information follows. Path: /batch?id=328&op=do_nojs&op=do StatusText: parsererror ResponseText: Redirecting https://news.google.com/rss/articles/CBMiTmh0dHBzOi8vd3d3Lm15bG9uZG9uLm5ld3MvbmV3cy9wcm9wZXJ0eS9pbS1lc3RhdGUtYWdlbnQtcmVudGluZy1zb3V0aC0yNjA2MDI1ONIBUmh0dHBzOi8vd3d3Lm15bG9uZG9uLm5ld3MvbmV3cy9wcm9wZXJ0eS9pbS1lc3RhdGUtYWdlbnQtcmVudGluZy1zb3V0aC0yNjA2MDI1OC5hbXA?oc=5 to https://consent.google.com/m?continue=https://news.google.com/rss/articles/CBMiTmh0dHBzOi8vd3d3Lm15bG9uZG9uLm5ld3MvbmV3cy9wcm9wZXJ0eS9pbS1lc3RhdGUtYWdlbnQtcmVudGluZy1zb3V0aC0yNjA2MDI1ONIBUmh0dHBzOi8vd3d3Lm15bG9uZG9uLm5ld3MvbmV3cy9wcm9wZXJ0eS9pbS1lc3RhdGUtYWdlbnQtcmVudGluZy1zb3V0aC0yNjA2MDI1OC5hbXA?oc%3D5&gl=GB&m=0&pc=n&hl=en-US&src=1 Redirecting https://consent.google.com/m?continue=https://news.google.com/rss/articles/CBMiTmh0dHBzOi8vd3d3Lm15bG9uZG9uLm5ld3MvbmV3cy9wcm9wZXJ0eS9pbS1lc3RhdGUtYWdlbnQtcmVudGluZy1zb3V0aC0yNjA2MDI1ONIBUmh0dHBzOi8vd3d3Lm15bG9uZG9uLm5ld3MvbmV3cy9wcm9wZXJ0eS9pbS1lc3RhdGUtYWdlbnQtcmVudGluZy1zb3V0aC0yNjA2MDI1OC5hbXA?oc%3D5&gl=GB&m=0&pc=n&hl=en-US&src=1 to https://news.google.com/rss/articles/CBMiTmh0dHBzOi8vd3d3Lm15bG9uZG9uLm5ld3MvbmV3cy9wcm9wZXJ0eS9pbS1lc3RhdGUtYWdlbnQtcmVudGluZy1zb3V0aC0yNjA2MDI1ONIBUmh0dHBzOi8vd3d3Lm15bG9uZG9uLm5ld3MvbmV3cy9wcm9wZXJ0eS9pbS1lc3RhdGUtYWdlbnQtcmVudGluZy1zb3V0aC0yNjA2MDI1OC5hbXA?oc=5&ucbcb=1 Redirecting https://news.google.com/rss/articles/CBMiTmh0dHBzOi8vd3d3Lm15bG9uZG9uLm5ld3MvbmV3cy9wcm9wZXJ0eS9pbS1lc3RhdGUtYWdlbnQtcmVudGluZy1zb3V0aC0yNjA2MDI1ONIBUmh0dHBzOi8vd3d3Lm15bG9uZG9uLm5ld3MvbmV3cy9wcm9wZXJ0eS9pbS1lc3RhdGUtYWdlbnQtcmVudGluZy1zb3V0aC0yNjA2MDI1OC5hbXA?oc=5&ucbcb=1 to https://news.google.com/rss/articles/CBMiTmh0dHBzOi8vd3d3Lm15bG9uZG9uLm5ld3MvbmV3cy9wcm9wZXJ0eS9pbS1lc3RhdGUtYWdlbnQtcmVudGluZy1zb3V0aC0yNjA2MDI1ONIBUmh0dHBzOi8vd3d3Lm15bG9uZG9uLm5ld3MvbmV3cy9wcm9wZXJ0eS9pbS1lc3RhdGUtYWdlbnQtcmVudGluZy1zb3V0aC0yNjA2MDI1OC5hbXA?oc=5&ucbcb=1&hl=en-GB&gl=GB&ceid=GB:en
This appeared to be working fine prior to updating to d10 that also includes symfony 4-6 update behind the scenes, so not sure if that is related?
After looking into this a little more I believe the issue I was having is more to do with Google using Javascript to handle the redirect. I have tested this by turning javascript off in the browser and doing so the redirect does not work. This is in combination with all News links in rss feeds now linking to Google first rather than the final source.
So to overcome this I have had to add an additional step that extracts the url from this middle page which I can then use to do the final lookup.
I'm a beginner of AMP from Japan.
Now I'm in trouble dealing with a error that is output when I introduce AMP into my WordPress webpage.
I cloud activate the AMP plugin and display an AMP of the post page without problem.
But the following error was output on my browser console when I added #development=1 to the end of URL of the post AMP to confirm whether the post AMP was configured as a valid AMP on Google.
Failed to load resource: the server responded with a status of 404 ()
https://cdn.ampproject.org/v0/validator_minified.js.sourcemap
Then I accessed to the above URL described in the error message, the following error page was displayed.
Google
404. That’s an error.
The requested URL /v0/validator_minified.js.sourcemap was not found on this server. That’s all we know.
I guess the output post AMP may not be recognized by Google as a structure of AMP if this error page was displayed.
But I have no idea to resolve the 404 error and can't progress any more.
In other words, I'd like to know some solution and hints to resolve the 404 error in order that Google recognizes my post AMP.
If you have some solution or hints, I'd be very helpful if you provide them for me.
Thanks in advance.
clear your cache in the server and delete your log. Blocking an malicious IP trafics and your see the IP in 30 per connection then you want blocked the IP.
Using proxy or like mitigation
I have been trying to enable HTTPS login on alfresco but it seems to be a challenge to get it working.
I can access my website via HTTPS and get the login page, but when I login with the correct credentials I get the following error :
Something's wrong with this page...
We may have hit an error or something might have been removed or deleted, so check that the URL is correct.
Alternatively you might not have permission to view the page (it could be on a private site) or there could have been an internal error. Try checking with your IT team.
If you're trying to get to your home page and it's no longer available you should change it by clicking your name on the toolbar.
I must login in HTTP then refresh my HTTPS page to be connected in HTTPS.
I have already seen what the offical doc says and tested it but it didn't work.
Has anyone an idea on how to fix the problem ?
Thanks
The alfresco.log / catalina.out should tell your more.
Where / how did you set up https? Have a a reverse proxy like nginx or apache in front of the alfresco tomcat?
If the log says something like "CSRF Token Filter issue" then you need to set share.host / port / protocol in alfresco-global.properties as seen from the browser.
Just wondering if someone can help.
I have setup alogolia plugin in wordpress and try to index the content. However, only some data is indexed and I keep getting an error on the indexing page in woocommerce.
I get the following error:
wp_remote_post() failed, indexing won't work. Checkout the logs for more details.
URL called: https://www.latestbuy.com.au/wp-admin/admin-post.php
Also, when I try to search on the site, I get the following error in the console
POST https://02ywvd0g5t-dsn.algolia.net/1/indexes/wp_terms_product_cat/query?x-a…plication-id=02YWVD0G5T&x-algolia-api-key=9bf593cf7f7dd2a8388ab640dd14a924 404 (Not Found)
Uncaught Error: Index wp_terms_product_cat does not exist(…)
I have tried this on two different servers and two different hosts and get the same issue.
Any one experienced this?
Thanks.
Vish
The plugin does need your WordPress instance to be able to reach itself over http or https protocol.
This is required so that we avoid reaching max memory limit or max execution time limit.
In your case you are using SSL.
If your ssl certificate is not valid or can not be handled by your openssl library AND your website is also available over http, you can add the following line to your wp-config.php file:
define( 'ALGOLIA_LOOPBACK_HTTP', true );
This will force the loopback calls to happen over http instead of https.
If that doesn't solve your issue, please post the log details of wp_remote_post error available on the 'Logs' page as a comment.
I am trying to call a php website through API, which gives the below Error 403.
Kindly check my code below. If anyone has a solution kindly help me.
I guess your request is true, but the website detects that an application tries to get to website and blocks the request to stop scrapping website.
If you want to pass the server filter, I think you should check a request to this website from a browser and then add the browser headers to your request so the server assume it as a browser and will accept it.