# Change Protocol For Certain Files

**URL:** <https://forum.infinityfree.com/t/change-protocol-for-certain-files/52100>\
**Category:** Hosting Support\
**Created:** [September 23, 2021, 2:58pm UTC](https://forum.infinityfree.com/t/change-protocol-for-certain-files/52100 "2021-09-23T14:58:29Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![anon20706563](https://forum.infinityfree.com/letter_avatar/anon20706563/32/5_5575768a8748004e209b776fc1b2916d.png) [@anon20706563](https://forum.infinityfree.com/u/anon20706563)\
**Post date:** [September 23, 2021, 2:58pm UTC](https://forum.infinityfree.com/t/change-protocol-for-certain-files/52100/1 "2021-09-23T14:58:29Z")

</div>

I followed the steps in one of your articles to force all traffic to go to https. I’m wondering if it’s possible to exclude some files from this change so that only those can be viewed at http?

---

<div class="post-metadata">

**Author:** ![jaikrishna.t](https://forum.infinityfree.com/user_avatar/forum.infinityfree.com/jaikrishna.t/32/57109_2.png) [@jaikrishna.t](https://forum.infinityfree.com/u/jaikrishna.t)\
**Post date:** [September 23, 2021, 3:01pm UTC](https://forum.infinityfree.com/t/change-protocol-for-certain-files/52100/2 "2021-09-23T15:01:03Z")

</div>

I think you can perhaps make a redirect?

---

<div class="post-metadata">

**Author:** ![wackyblackie](https://forum.infinityfree.com/user_avatar/forum.infinityfree.com/wackyblackie/32/43350_2.png) [@wackyblackie](https://forum.infinityfree.com/u/wackyblackie)\
**Post date:** [September 23, 2021, 3:01pm UTC](https://forum.infinityfree.com/t/change-protocol-for-certain-files/52100/3 "2021-09-23T15:01:17Z")

</div>

You could add a rule to your .htaccess for that specific file

---

<div class="post-metadata">

**Author:** ![anon20706563](https://forum.infinityfree.com/letter_avatar/anon20706563/32/5_5575768a8748004e209b776fc1b2916d.png) [@anon20706563](https://forum.infinityfree.com/u/anon20706563)\
**Post date:** [September 23, 2021, 3:03pm UTC](https://forum.infinityfree.com/t/change-protocol-for-certain-files/52100/4 "2021-09-23T15:03:53Z")

</div>

What would I type there for that? I’ve never done this.

---

<div class="post-metadata">

**Author:** ![anon20706563](https://forum.infinityfree.com/letter_avatar/anon20706563/32/5_5575768a8748004e209b776fc1b2916d.png) [@anon20706563](https://forum.infinityfree.com/u/anon20706563)\
**Post date:** [September 23, 2021, 3:04pm UTC](https://forum.infinityfree.com/t/change-protocol-for-certain-files/52100/5 "2021-09-23T15:04:30Z")

</div>

That might cause an endless redirect loop.

---

<div class="post-metadata">

**Author:** ![jaikrishna.t](https://forum.infinityfree.com/user_avatar/forum.infinityfree.com/jaikrishna.t/32/57109_2.png) [@jaikrishna.t](https://forum.infinityfree.com/u/jaikrishna.t)\
**Post date:** [September 23, 2021, 3:06pm UTC](https://forum.infinityfree.com/t/change-protocol-for-certain-files/52100/6 "2021-09-23T15:06:20Z")

</div>

## Redirecting a single URL

Using Redirect in an .htaccess file enables you to redirect users from an old page to a new page without having to keep the old page. For example, if you use index.html as your index file and then later rename index.html to home.html, you could set up a redirect to send users from index.html to home.html. For example:

```auto
    **Redirect to a local site file**

    Redirect /path/to/old/file/old.html /path/to/new/file/new.html

    **Redirect to an external site file**

    Redirect /path/to/old/file/old.html https://www.example.com/new/file/new.html

```

---

<div class="post-metadata">

**Author:** ![jaikrishna.t](https://forum.infinityfree.com/user_avatar/forum.infinityfree.com/jaikrishna.t/32/57109_2.png) [@jaikrishna.t](https://forum.infinityfree.com/u/jaikrishna.t)\
**Post date:** [September 23, 2021, 3:06pm UTC](https://forum.infinityfree.com/t/change-protocol-for-certain-files/52100/7 "2021-09-23T15:06:50Z")

</div>

This may work, never tried it, LOL

---

<div class="post-metadata">

**Author:** ![anon20706563](https://forum.infinityfree.com/letter_avatar/anon20706563/32/5_5575768a8748004e209b776fc1b2916d.png) [@anon20706563](https://forum.infinityfree.com/u/anon20706563)\
**Post date:** [September 23, 2021, 3:07pm UTC](https://forum.infinityfree.com/t/change-protocol-for-certain-files/52100/8 "2021-09-23T15:07:40Z")

</div>

I don’t have a new and an old version though.

---

<div class="post-metadata">

**Author:** ![wackyblackie](https://forum.infinityfree.com/user_avatar/forum.infinityfree.com/wackyblackie/32/43350_2.png) [@wackyblackie](https://forum.infinityfree.com/u/wackyblackie)\
**Post date:** [September 23, 2021, 3:08pm UTC](https://forum.infinityfree.com/t/change-protocol-for-certain-files/52100/9 "2021-09-23T15:08:04Z")

</div>

You could try:

```auto
RewriteCond %{HTTP:X-Forwarded-Proto} =https
RewriteCond %{REQUEST_FILENAME} =<URL of the file without domain>
RewriteRule (.*) http://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

```

and replace `<URL of the file without domain>` with say `/example.txt`.

I haven’t tested this though.

---

<div class="post-metadata">

**Author:** ![jaikrishna.t](https://forum.infinityfree.com/user_avatar/forum.infinityfree.com/jaikrishna.t/32/57109_2.png) [@jaikrishna.t](https://forum.infinityfree.com/u/jaikrishna.t)\
**Post date:** [September 23, 2021, 3:08pm UTC](https://forum.infinityfree.com/t/change-protocol-for-certain-files/52100/10 "2021-09-23T15:08:15Z")

</div>

Just ignore that. Redirect https to http, I guess

---

<div class="post-metadata">

**Author:** ![anon20706563](https://forum.infinityfree.com/letter_avatar/anon20706563/32/5_5575768a8748004e209b776fc1b2916d.png) [@anon20706563](https://forum.infinityfree.com/u/anon20706563)\
**Post date:** [September 23, 2021, 3:11pm UTC](https://forum.infinityfree.com/t/change-protocol-for-certain-files/52100/11 "2021-09-23T15:11:25Z")

</div>

Does it take time to take effect? It won’t work.

This is the URL by the way:

[http://files.rydercragie.com/Other/WebsiteIcons.html](http://files.rydercragie.com/Other/WebsiteIcons.html)

This is what my htaccess file looks like:

 ![Screenshot 2021-09-23 at 16.11.44](https://forum-cdn.infinityfree.net/original/3X/3/b/3b2233012eea0202a99743ab53898f1bb283c4c3.jpeg)

---

<div class="post-metadata">

**Author:** ![Greenreader9](https://forum.infinityfree.com/user_avatar/forum.infinityfree.com/greenreader9/32/22847_2.png) [@Greenreader9](https://forum.infinityfree.com/u/Greenreader9)\
**Post date:** [September 23, 2021, 3:13pm UTC](https://forum.infinityfree.com/t/change-protocol-for-certain-files/52100/12 "2021-09-23T15:13:57Z")

</div>

Why do you need it on HTTP? That’s not the best idea, and some browsers will detect the mixed content, showing a warning to users.

---

<div class="post-metadata">

**Author:** ![anon20706563](https://forum.infinityfree.com/letter_avatar/anon20706563/32/5_5575768a8748004e209b776fc1b2916d.png) [@anon20706563](https://forum.infinityfree.com/u/anon20706563)\
**Post date:** [September 23, 2021, 3:14pm UTC](https://forum.infinityfree.com/t/change-protocol-for-certain-files/52100/13 "2021-09-23T15:14:23Z")

</div>

Trying to update the iframe on my main website. The white flash is annoying me. But it won’t load when I embed it on my site. I think using it with http might work better. That said, it might not.

---

<div class="post-metadata">

**Author:** ![jaikrishna.t](https://forum.infinityfree.com/user_avatar/forum.infinityfree.com/jaikrishna.t/32/57109_2.png) [@jaikrishna.t](https://forum.infinityfree.com/u/jaikrishna.t)\
**Post date:** [September 23, 2021, 3:15pm UTC](https://forum.infinityfree.com/t/change-protocol-for-certain-files/52100/14 "2021-09-23T15:15:04Z")

</div>

Nah, it after all redirects to https

---

<div class="post-metadata">

**Author:** ![Greenreader9](https://forum.infinityfree.com/user_avatar/forum.infinityfree.com/greenreader9/32/22847_2.png) [@Greenreader9](https://forum.infinityfree.com/u/Greenreader9)\
**Post date:** [September 23, 2021, 3:28pm UTC](https://forum.infinityfree.com/t/change-protocol-for-certain-files/52100/15 "2021-09-23T15:28:30Z")

</div>

> [@anon20706563](#):
>
> The white flash is annoying me.

I don’t see a white flash on the URL you provided.

---

<div class="post-metadata">

**Author:** ![wackyblackie](https://forum.infinityfree.com/user_avatar/forum.infinityfree.com/wackyblackie/32/43350_2.png) [@wackyblackie](https://forum.infinityfree.com/u/wackyblackie)\
**Post date:** [September 23, 2021, 3:40pm UTC](https://forum.infinityfree.com/t/change-protocol-for-certain-files/52100/16 "2021-09-23T15:40:10Z")

</div>

I have highlighted some errors in your code:

 ![Screenshot 2021-09-23 at 16.11.44 (2)](https://forum-cdn.infinityfree.net/original/3X/d/2/d265848b48d3137cd0e4945fbbe02dd64ec95376.jpeg)

This is looking for `</Other/WebsiteIcons.html>` not `/Other/WebsiteIcons.html`. Try replacing the code block I posted earlier with this:

```auto
RewriteCond %{HTTP:X-Forwarded-Proto} =https
RewriteCond %{REQUEST_FILENAME} =/Other/WebsiteIcons.html
RewriteRule (.*) http://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

```

---

<div class="post-metadata">

**Author:** ![anon20706563](https://forum.infinityfree.com/letter_avatar/anon20706563/32/5_5575768a8748004e209b776fc1b2916d.png) [@anon20706563](https://forum.infinityfree.com/u/anon20706563)\
**Post date:** [September 23, 2021, 5:17pm UTC](https://forum.infinityfree.com/t/change-protocol-for-certain-files/52100/17 "2021-09-23T17:17:30Z")

</div>

Done.

 ![Screenshot 2021-09-23 at 18.17.16](https://forum-cdn.infinityfree.net/original/3X/4/2/42ea319bbc9ac96109e818ad55f6b48025e10890.jpeg)

---

<div class="post-metadata">

**Author:** ![anon20706563](https://forum.infinityfree.com/letter_avatar/anon20706563/32/5_5575768a8748004e209b776fc1b2916d.png) [@anon20706563](https://forum.infinityfree.com/u/anon20706563)\
**Post date:** [September 23, 2021, 5:45pm UTC](https://forum.infinityfree.com/t/change-protocol-for-certain-files/52100/18 "2021-09-23T17:45:55Z")

</div>

I mean [RyderCragie.com](http://RyderCragie.com). Hence “main website”.

 ![Screenshot 2021-09-23 at 18.47.09 2](https://forum-cdn.infinityfree.net/original/3X/e/3/e3d1a017c4db009c2517a51706be5e99465d2ade.jpeg)

---

<div class="post-metadata">

**Author:** ![Admin](https://forum.infinityfree.com/user_avatar/forum.infinityfree.com/admin/32/36437_2.png) [@Admin](https://forum.infinityfree.com/u/Admin)\
**Post date:** [September 23, 2021, 5:49pm UTC](https://forum.infinityfree.com/t/change-protocol-for-certain-files/52100/19 "2021-09-23T17:49:58Z")

</div>

For starters, if you try to embed a HTTP resource in an HTTPS page, the HTTP resource will just not load. Modern browsers refuse to load in unprotected assets in a protected page for security.

An iframe means the browser has to request a new page from the server, the server has to fetch it, the browser has to download it and then render the content. This takes a bit of time. If you don’t want this, then not using iframes is probably your best bet.

---

<div class="post-metadata">

**Author:** ![anon20706563](https://forum.infinityfree.com/letter_avatar/anon20706563/32/5_5575768a8748004e209b776fc1b2916d.png) [@anon20706563](https://forum.infinityfree.com/u/anon20706563)\
**Post date:** [September 23, 2021, 6:02pm UTC](https://forum.infinityfree.com/t/change-protocol-for-certain-files/52100/20 "2021-09-23T18:02:47Z")

</div>

Thanks. I’ve asked somewhere else to see if they can help me fix the code.

[Next page](https://forum.infinityfree.com/t/change-protocol-for-certain-files/52100.md?page=2)
