# File URLs change when pages are moved or made invisible

**URL:** https://forum.getkirby.com/t/file-urls-change-when-pages-are-moved-or-made-invisible/5348
**Category:** Questions
**Tags:** v2
**Created:** [September 28, 2016, 11:32am UTC](https://forum.getkirby.com/t/file-urls-change-when-pages-are-moved-or-made-invisible/5348 "2016-09-28T11:32:22Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![Tabbykitten](https://avatars.discourse-cdn.com/v4/letter/t/bc8723/32.png) [@Tabbykitten](https://forum.getkirby.com/u/Tabbykitten)
#### Post date: [September 28, 2016, 11:32am UTC](https://forum.getkirby.com/t/file-urls-change-when-pages-are-moved-or-made-invisible/5348/1 "2016-09-28T11:32:22Z")

</div>

Looking forward to exploring the new features but wanted to know if it addresses the visibility/invisibility issue I am facing:

When a page is deactivated or is invisible it doesn’t have a sequence number in its content URL:

Invisble:

> **[URL.com - MediaOptions](https://mediaoptions.com/brokered-domains/url-com/)**
>
> URL.com is a sought-after domain that MediaOptions can help broker for you. Contact us today to get the domain name your company needs!

Visible:

> **[URL.com - MediaOptions](https://mediaoptions.com/brokered-domains/url-com/)**
>
> URL.com is a sought-after domain that MediaOptions can help broker for you. Contact us today to get the domain name your company needs!

We have a long list of about 30 pages so if we deactivate it make invisible a page in the middle, like 15, then all subsequent pages that are visible shift up in their sequence number, leaving all content links that may have been indexed by Google broken.

Is there any way to control the visibility of a section/page without disrupting the content URL?

Any help would be greatly appreciated. Our small business depends on our images ranking.

Thank you in advance

---

<div class="post-metadata">

### Author: ![bastianallgeier](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/bastianallgeier/32/7569_2.png) [@bastianallgeier](https://forum.getkirby.com/u/bastianallgeier)
#### Post date: [September 28, 2016, 11:44am UTC](https://forum.getkirby.com/t/file-urls-change-when-pages-are-moved-or-made-invisible/5348/2 "2016-09-28T11:44:08Z")

</div>

> [@Kirby 2.4.0 Beta 1 is here!](https://forum.getkirby.com/t/kirby-2-4-0-beta-1-is-here/5344/7):
>
> [http://url.com/content/section/page/image-01.pdf](http://url.com/content/section/page/image-01.pdf)

You can always access files with the direct URL of the page and the filename. So even if the page is invisible, the URL [http://url.com/section/page/image-01.pdf](http://url.com/section/page/image-01.pdf) should be working.

---

<div class="post-metadata">

### Author: ![Tabbykitten](https://avatars.discourse-cdn.com/v4/letter/t/bc8723/32.png) [@Tabbykitten](https://forum.getkirby.com/u/Tabbykitten)
#### Post date: [September 28, 2016, 12:22pm UTC](https://forum.getkirby.com/t/file-urls-change-when-pages-are-moved-or-made-invisible/5348/3 "2016-09-28T12:22:50Z")

</div>

Yes but, what I am concern about is the content on the other pages that are still visible. If all their sequence numbers change as a result of me making a page above them invisible, then all of their content links are broken:

1\_cat  
2\_dog  
3\_tree  
4\_milk  
5\_house  
6\_cactus

If I make tree invisible it shifts everything up

1\_cat  
2\_dog  
3\_milk  
4\_house  
5\_cactus

Therefore breaking content links for milk, house, and cactus. This is important for Google indexing and incoming links from other websites and blogs.

Is there a way to control visibility without automatically effecting the sequence number? This is a major problem I am facing with the site structure.

---

<div class="post-metadata">

### Author: ![bastianallgeier](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/bastianallgeier/32/7569_2.png) [@bastianallgeier](https://forum.getkirby.com/u/bastianallgeier)
#### Post date: [September 28, 2016, 12:34pm UTC](https://forum.getkirby.com/t/file-urls-change-when-pages-are-moved-or-made-invisible/5348/4 "2016-09-28T12:34:18Z")

</div>

No, Kirby never includes the sorting numbers in the URLs of pages. So Google won’t be affected if you sort pages.

---

<div class="post-metadata">

### Author: ![PaulMorel](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/paulmorel/32/371_2.png) [@PaulMorel](https://forum.getkirby.com/u/PaulMorel)
#### Post date: [September 28, 2016, 12:37pm UTC](https://forum.getkirby.com/t/file-urls-change-when-pages-are-moved-or-made-invisible/5348/5 "2016-09-28T12:37:29Z")

</div>

Is it still the case for files uploaded to pages?

---

<div class="post-metadata">

### Author: ![Tabbykitten](https://avatars.discourse-cdn.com/v4/letter/t/bc8723/32.png) [@Tabbykitten](https://forum.getkirby.com/u/Tabbykitten)
#### Post date: [September 28, 2016, 12:49pm UTC](https://forum.getkirby.com/t/file-urls-change-when-pages-are-moved-or-made-invisible/5348/6 "2016-09-28T12:49:01Z")

</div>

Kirby doesn’t include the sorting numbers in the outward facing page URL:

> **[With Projects](http://www.withprojects.org/curation/keegan-mchargue?category=all)**
>
> With Projects, Inc. imagines artistic and commercial projects from concept to execution.

**BUT IT DOES FOR THE CONTENT URL (images, pdfs, etc files)**

[![](http://www.withprojects.org/content/2-curation/11-keegan-mchargue/keegan.jpg) ](http://www.withprojects.org/content/2-curation/11-keegan-mchargue/keegan.jpg)  
[![](http://www.withprojects.org/content/2-curation/12-kingsboro/kingsboro-opti.jpg) ](http://www.withprojects.org/content/2-curation/12-kingsboro/kingsboro-opti.jpg)  
[![](http://www.withprojects.org/content/2-curation/13-museum-of-art-design/ilbaso.gif) ](http://www.withprojects.org/content/2-curation/13-museum-of-art-design/ilbaso.gif)  
[![](http://www.withprojects.org/content/2-curation/14-nada-miami/00.jpg) ](http://www.withprojects.org/content/2-curation/14-nada-miami/00.jpg)

So, if I decide to make one of these pages invisible, like “12-kingsboro” then the subsequent URLS will look like this:

[![](http://www.withprojects.org/content/2-curation/11-keegan-mchargue/keegan.jpg) ](http://www.withprojects.org/content/2-curation/11-keegan-mchargue/keegan.jpg)  
[http://www.withprojects.org/content/2-curation/12-museum-of-art-design/ilbaso.gif](http://www.withprojects.org/content/2-curation/12-museum-of-art-design/ilbaso.gif)  
[http://www.withprojects.org/content/2-curation/13-nada-miami/00.jpg](http://www.withprojects.org/content/2-curation/13-nada-miami/00.jpg)

Therefore this breaks the IMAGE URL. Google uses these URLS to index images, so if they break by adjusting visibility or even reordering the list, that is a huge problem that I would really like resolved.

I enjoy Kirby very much, but this is a very big issue especially if my clients are dependent on their content ranking and not breaking. They should have the ability to activate/deactivate their projects without this worry.

Any help would be appreciated.

---

<div class="post-metadata">

### Author: ![Tabbykitten](https://avatars.discourse-cdn.com/v4/letter/t/bc8723/32.png) [@Tabbykitten](https://forum.getkirby.com/u/Tabbykitten)
#### Post date: [September 28, 2016, 12:55pm UTC](https://forum.getkirby.com/t/file-urls-change-when-pages-are-moved-or-made-invisible/5348/7 "2016-09-28T12:55:10Z")

</div>

![](https://europe1.discourse-cdn.com/flex017/uploads/getkirby/original/2X/d/d989b559f5db6b2f751308cd4d6463882ba4298a.png)

---

<div class="post-metadata">

### Author: ![bastianallgeier](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/bastianallgeier/32/7569_2.png) [@bastianallgeier](https://forum.getkirby.com/u/bastianallgeier)
#### Post date: [September 28, 2016, 1:22pm UTC](https://forum.getkirby.com/t/file-urls-change-when-pages-are-moved-or-made-invisible/5348/8 "2016-09-28T13:22:22Z")

</div>

For now you can do:

```php
<?= $page->url() . '/' . $file->filename() ?> 

```

in your templates to get the static URL to the files. We might consider adding an option to make this the default if you have to have this.

---

<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: [September 28, 2016, 1:23pm UTC](https://forum.getkirby.com/t/file-urls-change-when-pages-are-moved-or-made-invisible/5348/9 "2016-09-28T13:23:50Z")

</div>

We have seen this requirement more than once, so an option would be great 🙂

---

<div class="post-metadata">

### Author: ![Tabbykitten](https://avatars.discourse-cdn.com/v4/letter/t/bc8723/32.png) [@Tabbykitten](https://forum.getkirby.com/u/Tabbykitten)
#### Post date: [September 28, 2016, 1:36pm UTC](https://forum.getkirby.com/t/file-urls-change-when-pages-are-moved-or-made-invisible/5348/10 "2016-09-28T13:36:45Z")

</div>

It would be extremely useful and solves an integral problem with how the site works. This would be an essential update. Please please please consider this as an option.

I like using kirby, but for client work I have had to switch back to wordpress because of this very issue. There should be an easier way to active/deactivate pages without effecting content links elsewhere.

I look forward to the update!

---

<div class="post-metadata">

### Author: ![Tabbykitten](https://avatars.discourse-cdn.com/v4/letter/t/bc8723/32.png) [@Tabbykitten](https://forum.getkirby.com/u/Tabbykitten)
#### Post date: [September 28, 2016, 4:07pm UTC](https://forum.getkirby.com/t/file-urls-change-when-pages-are-moved-or-made-invisible/5348/11 "2016-09-28T16:07:50Z")

</div>

Also, wanted to clarify.

I am not suggesting that you get rid of the numbering system or re-do the entire structure in which Kirby is built.

I am just suggesting that there should be a way to control visibility/invisibility and sorting without changing the sequence number that is assigned to the page upon it’s creation. The original numbers can definitely stay, as long as they stay fixed.

Thank you again, much appreciated.

---

<div class="post-metadata">

### Author: ![lukasbestle](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/lukasbestle/32/11437_2.png) [@lukasbestle](https://forum.getkirby.com/u/lukasbestle)
#### Post date: [September 28, 2016, 5:36pm UTC](https://forum.getkirby.com/t/file-urls-change-when-pages-are-moved-or-made-invisible/5348/12 "2016-09-28T17:36:05Z")

</div>

Well, if the numbers should be fixed, that _would_ mean that we would get rid of the numbering system.

What Bastian proposed above is that we will provide an option that the file URLs without numbers are used, not an option to change the numbering system.

Have you tried Bastian’s code example? This should fix the issues you are having until we make this an option in Kirby.

---

<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: [September 28, 2016, 5:39pm UTC](https://forum.getkirby.com/t/file-urls-change-when-pages-are-moved-or-made-invisible/5348/13 "2016-09-28T17:39:07Z")

</div>

Yes, fixed numbers would not even make sense, because it would disable the possibility to change the order of pages.

---

<div class="post-metadata">

### Author: ![AugustMiller](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/augustmiller/32/160_2.png) [@AugustMiller](https://forum.getkirby.com/u/AugustMiller)
#### Post date: [September 28, 2016, 5:47pm UTC](https://forum.getkirby.com/t/file-urls-change-when-pages-are-moved-or-made-invisible/5348/14 "2016-09-28T17:47:04Z")

</div>

The This can be implemented as a file object method, too—

```php
kirby()->set('file::method', 'safeUrl', function ($file) {
  return $file->page()->url() . '/' . $file->filename();
};

```

Untested, but should make this a little cleaner in your templates!

---

<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: [September 28, 2016, 7:06pm UTC](https://forum.getkirby.com/t/file-urls-change-when-pages-are-moved-or-made-invisible/5348/15 "2016-09-28T19:06:35Z")

</div>

> [@bastianallgeier](#):
>
> \<?= $page-\>url() . ‘/’ . $file-\>filename() ?\>

Unfortunately, this does not help when you use images in text area fields … So we would need a solution that takes care of those images as well.

---

<div class="post-metadata">

### Author: ![lukasbestle](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/lukasbestle/32/11437_2.png) [@lukasbestle](https://forum.getkirby.com/u/lukasbestle)
#### Post date: [September 28, 2016, 7:19pm UTC](https://forum.getkirby.com/t/file-urls-change-when-pages-are-moved-or-made-invisible/5348/16 "2016-09-28T19:19:20Z")

</div>

Do you mean inside Kirbytext? Yes, that’s true. I think we should just add an option that will then be checked in `$file->url()` directly. Then it works everywhere.

---

<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: [September 28, 2016, 7:21pm UTC](https://forum.getkirby.com/t/file-urls-change-when-pages-are-moved-or-made-invisible/5348/17 "2016-09-28T19:21:43Z")

</div>

> [@lukasbestle](#):
>
> Do you mean inside Kirbytext?

Yep, that’s what I meant.

---

<div class="post-metadata">

### Author: ![philipp](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/philipp/32/4572_2.png) [@philipp](https://forum.getkirby.com/u/philipp)
#### Post date: [September 29, 2016, 6:10am UTC](https://forum.getkirby.com/t/file-urls-change-when-pages-are-moved-or-made-invisible/5348/18 "2016-09-29T06:10:14Z")

</div>

It was proposed to Add an underscore, instead of removing the number, which sounds like a good idea imho.

> [@Kill the current menu system](https://forum.getkirby.com/t/kill-the-current-menu-system/1445):
>
> I know the topic title is quite strong, but I just want to wake you up for a discussion. The menu is depending on first part in the slug Even from Kirby 1 I did not like the menu system. It’s because it’s driven by the first part of the slug, if it’s a number or not. Why is this a problem? I have a page about what can happen in 30 days. In the panel I add a new page with the title… 30 days …then it will generate the slug… 30-days Fine, that’s just what I want. Then when I visit the page I…

---

<div class="post-metadata">

### Author: ![anon77445132](https://avatars.discourse-cdn.com/v4/letter/a/4da419/32.png) [@anon77445132](https://forum.getkirby.com/u/anon77445132)
#### Post date: [September 30, 2016, 12:55pm UTC](https://forum.getkirby.com/t/file-urls-change-when-pages-are-moved-or-made-invisible/5348/19 "2016-09-30T12:55:58Z")

</div>

> [@philipp](#):
>
> sounds like a good idea imho.

I agree to this great idea.

But what’s about in an older post about needing a new request for this?

---

<div class="post-metadata">

### Author: ![ron\_jeremy](https://avatars.discourse-cdn.com/v4/letter/r/ee7513/32.png) [@ron\_jeremy](https://forum.getkirby.com/u/ron_jeremy)
#### Post date: [October 1, 2016, 3:34am UTC](https://forum.getkirby.com/t/file-urls-change-when-pages-are-moved-or-made-invisible/5348/20 "2016-10-01T03:34:32Z")

</div>

Is this a real and serious problem with Kirby’s core structure/underpinnings?

[Next page](https://forum.getkirby.com/t/file-urls-change-when-pages-are-moved-or-made-invisible/5348.md?page=2)
