# Link to html file

**URL:** <https://forum.getkirby.com/t/link-to-html-file/16993>\
**Category:** Questions\
**Tags:** v3\
**Created:** [January 27, 2020, 8:04pm UTC](https://forum.getkirby.com/t/link-to-html-file/16993 "2020-01-27T20:04:13Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)\
**Post date:** [January 27, 2020, 9:07pm UTC](https://forum.getkirby.com/t/link-to-html-file/16993/5 "2020-01-27T21:07:27Z")

</div>

Or you can read the files in a template, like the approach I describe here: [Virtual pages from static HTML files (or something like that)](https://forum.getkirby.com/t/virtual-pages-from-static-html-files-or-something-like-that/16215/2)

Or a modified concept:

```auto
content/
  html-examples/
  html-examples.txt

```

Then a route:

```auto
 [
      'pattern' => 'html-examples/(:any)',
      'action' => function ($file) {
          $data = [
            'filename' => $file
          ];
          return page('html-examples')->render($data);
      }
    ],

```

html-examples.php controller

```auto
<?php

return function ($page, $filename) {

    return [
        'filename' => $filename
    ];
};

```

html-examples.php template

```auto
<?php
echo F::read($kirby->root('index'). '/'. $filename);

```

So when you call `http://yourdomain.com/html-examples/test.html`, it would read the `test.html` file from the root folder (or another given folder, where you store the examples).

In textfile, create link like this:

```auto
(link: html-examples/test.html)

```

---

_[View the full topic](https://forum.getkirby.com/t/link-to-html-file/16993)._
