• Hello,

    I am getting the error in my WP Hide & Security Enhancer dashboard that this error exists.

    Rewrite test failed! The wp_remote_get() returns a 403 error code:Forbidden
    A custom rewrite line has been inserted into your rewrite file for testing, the Test URL expected to return a JSON response (contains a name and description) The server instead replied a 403 error with the message Forbidden
    You need to get in touch with your server support for a fix, the rewrite engine is either disabled for your account or their internal setup does not allow such rewrites.
    
    However, my hosting company did confirm that the URL Is there and returned a correct response.  In addition, WP Hide & Security Enhancer options will load in my plugin dashboard.  
    
    This is the URL response. 
    {"name":"nsp-code\/wp-hide","description":"Hide your WordPress and increase Security for your site using smart techniques. No files are changed on your server. Change default WordPress files URLs and login url."}
    
    And the server response. 
    

    [olga.labova ~ 16:04:26]$ curl -IX GET https://www.manningstinson.com/rewrite_test_1643380423_72837
    HTTP/2 200
    date: Fri, 28 Jan 2022 15:04:29 GMT
    content-type: application/json
    cf-ray: 6d4b1d07bce211b3-BCN
    cache-control: max-age=0
    expires: Fri, 28 Jan 2022 15:04:28 GMT
    vary: Accept-Encoding, Accept-Encoding
    cf-cache-status: DYNAMIC
    expect-ct: max-age=604800, report-uri=”https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct”
    host-header: 6b7412fb82ca5edfd0917e3957f05d89
    sg-optimizer-worker-status: miss
    x-httpd: 1
    x-proxy-cache: MISS
    x-proxy-cache-info: 0 NC:000000 UP:SKIP_CACHE_MAX_AGE_ZERO
    report-to: {“endpoints”:[{“url”:”https:\/\/a.nel.cloudflare.com\/report\/v3?s=REOluulXXEphEThyTHMTr7HkAO7W2g9ZOtkGj6pkY0p524%2BkZAa7JLtQs2gUQfyfy6Pn2DaKhoQs%2F2bKtPTv0xSEvQfjZPGA56huipPay5xxgAy6Y9fatEF5SUIGzE%2BrYkRCCIPSroCw”}],”group”:”cf-nel”,”max_age”:604800}
    nel: {“success_fraction”:0,”report_to”:”cf-nel”,”max_age”:604800}
    server: cloudflare
    alt-svc: h3=”:443″; ma=86400, h3-29=”:443″; ma=86400`

    Why would it still show the rewrite test failed?

    Also, I will consider upgrading to pro, but I would like to get this working first.

    Thank you,
    Manning

Viewing 1 replies (of 1 total)
  • Plugin Contributor Maya

    (@tdgu)

    Hi,
    The plugin creates the sample rewrite, to call it later and establish if the rewrites are active/functional on the server-side. On your host, calling the link using the wp_remote_get() https://developer.ww.wp.xz.cn/reference/functions/wp_remote_get/ appears to returns a 403 error https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/403
    If directly calling the test URL within the browser does return a valid response, this may be caused by a number of factors, here are some details on which you can check:

    • Do you use an HTTP password? Doing so, the wp_remote_get() can’t access the area as there are no credentials passed through ( they may be stored on your browser data but not on the server-side ).
    • The wp_remote_get() arguments may get altered by another plugin, can you try to disable and see if there’s a difference in the response?
    • Practically, the wp_remote_get() is calling same/your domain which is for the same machine/server. Depending on the server configuration, rarely, this may create some kind of conflict. Your host support might provide additional details regarding this.

    You can simply create a PHP file and add a cURL call for the test URL https://code.tutsplus.com/tutorials/how-to-use-curl-in-php–cms-36732 Then see the returned response and forward it to your server support for more details.

    Thanks

Viewing 1 replies (of 1 total)

The topic ‘Error Code – Rewrite Forbidden’ is closed to new replies.