# Test a string to see if it contains http:// or https://

**URL:** <https://zola.discourse.group/t/test-a-string-to-see-if-it-contains-http-or-https/1344>\
**Category:** Support\
**Created:** [June 1, 2022, 10:39pm UTC](https://zola.discourse.group/t/test-a-string-to-see-if-it-contains-http-or-https/1344 "2022-06-01T22:39:26Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![one](https://avatars.discourse-cdn.com/v4/letter/o/90db22/32.png) [@one](https://zola.discourse.group/u/one)\
**Post date:** [June 1, 2022, 10:39pm UTC](https://zola.discourse.group/t/test-a-string-to-see-if-it-contains-http-or-https/1344/1 "2022-06-01T22:39:26Z")

</div>

I’ve been trying to find a way to test if a string contains http:// or https:// but haven’t been able to find a way to do this. Can anyone help please or point me in the right direction?

Background on what I’m trying to achieve:  
I’m using the [EasyDocs](https://www.getzola.org/themes/zola-easydocs-theme/) theme and I want to put a path for the logo to get it from my static folder. I managed to do this by modifying the theme code to use _get\_url(path=config.extra.logo)_ instead of just _config.extra.logo_. But this makes it incompatible with full URLs like _[https://easydocs.codeandmedia.com/logo.svg](https://easydocs.codeandmedia.com/logo.svg)_ which was the default in the theme. I’m trying to find a way to support either option (that is full URL or link to file in static), and the first thing I’ve been able to come up with is using a search on the string to find out if it starts with http or has http:// or https://. But I can’t quite understand how to do “starts with” or “contains” and haven’t been able to find anything after searching.

---

<div class="post-metadata">

**Author:** ![one](https://avatars.discourse-cdn.com/v4/letter/o/90db22/32.png) [@one](https://zola.discourse.group/u/one)\
**Post date:** [June 2, 2022, 12:43am UTC](https://zola.discourse.group/t/test-a-string-to-see-if-it-contains-http-or-https/1344/2 "2022-06-02T00:43:13Z")

</div>

Finally found it in the Tera documentation - [https://tera.netlify.app/docs/#starting-with](https://tera.netlify.app/docs/#starting-with)

## Excerpt from page:

### starting\_with

Returns true if the given variable is a string and starts with the arg given.

#### Example

```auto
{% if path is starting_with("x/") %}
    In section x
{% endif %}

```
