# Curl GET not returning page

**URL:** <https://community.localwp.com/t/curl-get-not-returning-page/43521>\
**Category:** Support\
**Tags:** curl-error\
**Created:** [June 29, 2024, 6:57pm UTC](https://community.localwp.com/t/curl-get-not-returning-page/43521 "2024-06-29T18:57:07Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![rickyg](https://sea1.discourse-cdn.com/flex019/user_avatar/community.localwp.com/rickyg/32/22128_2.png) [@rickyg](https://community.localwp.com/u/rickyg)\
**Post date:** [June 29, 2024, 6:57pm UTC](https://community.localwp.com/t/curl-get-not-returning-page/43521/1 "2024-06-29T18:57:07Z")

</div>

### Curl GET not returning page

using the command:

```auto
curl https://valuable-terrace.localsite.io/?p=24

```

does not return the page, but instead returns:

```auto
<html>
<head><title>308 Permanent Redirect</title></head>
<body>
<center><h1>308 Permanent Redirect</h1></center>
<hr><center>nginx</center>
</body>
</html>

```

How can I configure WPLocal(?) to return the page on a curl GET request? Thanks.  
rickyg.

### System Details

- **Local Version:**  
Version 9.0.4+6699

- **Operating System (OS) and OS version:**  
Edition Windows 10 Pro  
Version 22H2  
Installed on ‎10/‎12/‎2020  
OS build 19045.4529  
Experience Windows Feature Experience Pack 1000.19058.1000.0

* * *

### Local Logs

Log attached.  
[local-lightning-verbose.log](https://community.localwp.com/uploads/short-url/1o3KTxXFXmSN6WlJRZVSNeONvt2.log) (105.2 KB)

* * *

_ **Security Reminder** _  
Local does a pretty good job of scrubbing private info from the logs and the errors it produces, however there’s always the possibility that something private can come through. Because these are public forums, always review the screenshots you are sharing to make sure there isn’t private info like passwords being displayed.

---

<div class="post-metadata">

**Author:** ![ben.turner](https://sea1.discourse-cdn.com/flex019/user_avatar/community.localwp.com/ben.turner/32/5366_2.png) [@ben.turner](https://community.localwp.com/u/ben.turner)\
**Post date:** [July 1, 2024, 4:43pm UTC](https://community.localwp.com/t/curl-get-not-returning-page/43521/2 "2024-07-01T16:43:41Z")

</div>

I was able to access a page over Live Links using `curl` with something like this:

```auto
curl -L -sH 'Accept-encoding: gzip' "https://<username>:<password>@<subdomain>.localsite.io/" | gunzip -

```

So for example, something like:

```auto
curl -L -sH 'Accept-encoding: gzip' "https://paperweight:tricky@intelligent-papaya.localsite.io/?p=23" | gunzip -

```

Breaking it down a bit:

- The response is compressed, so you need to account for that in your command
- Live Links are protected by basic HTTPS auth, so you need to include those things in the url

> [@rickyg](#):
>
> `308 Permanent Redirect`

All that being said though, your command is giving a 308 response code, which almost seems like you are hitting the site, but _something_ is doing a redirect. Maybe you can try using the `-L` flag for curl to follow redirects? Or maybe temporarily disable whatever is causing that redirect to happen?

---

<div class="post-metadata">

**Author:** ![rickyg](https://sea1.discourse-cdn.com/flex019/user_avatar/community.localwp.com/rickyg/32/22128_2.png) [@rickyg](https://community.localwp.com/u/rickyg)\
**Post date:** [July 1, 2024, 6:26pm UTC](https://community.localwp.com/t/curl-get-not-returning-page/43521/3 "2024-07-01T18:26:46Z")

</div>

Thanks, Ben.

Are these two separate Curl transactions? 1) Can the first one be used to authenticate and then any number of curl requests can be used until the session is closed and reauthenticated again?

- or -

1. Does each curl transaction have to involve two commands. The first to authenticate, the second to run a specific curl command.

Appreciate your help in enlightening my understanding.

rickyg.

---

<div class="post-metadata">

**Author:** ![ben.turner](https://sea1.discourse-cdn.com/flex019/user_avatar/community.localwp.com/ben.turner/32/5366_2.png) [@ben.turner](https://community.localwp.com/u/ben.turner)\
**Post date:** [July 2, 2024, 4:04pm UTC](https://community.localwp.com/t/curl-get-not-returning-page/43521/4 "2024-07-02T16:04:54Z")

</div>

It’s just one Curl command that looks like two because we’re including some configuration headers. To explain things a little more in depth:

The `-L` is for “follow” in case there are any redirects. I don’t think that’s necessary for Live Links, but I often include it by habit because usually I want the actual “thing” I’m after, even if there is a redirect.

The `-sH 'Accept-encoding: gzip'` part is essentially saying “Add this header to the request” which in this case is letting the server know that we can accept a compressed response.

The next string in quotes is the url that we want to get things from.

---

<div class="post-metadata">

**Author:** ![system](https://sea1.discourse-cdn.com/flex019/user_avatar/community.localwp.com/system/32/1_2.png) [@system](https://community.localwp.com/u/system)\
**Post date:** [September 30, 2024, 4:05pm UTC](https://community.localwp.com/t/curl-get-not-returning-page/43521/5 "2024-09-30T16:05:44Z")

</div>

Closed on September 30, 2024, 4:05pm UTC

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
