# Who manages the htaccess file?

**URL:** <https://forum.getkirby.com/t/who-manages-the-htaccess-file/30818>\
**Category:** Questions\
**Tags:** v4\
**Created:** [February 17, 2024, 8:53am UTC](https://forum.getkirby.com/t/who-manages-the-htaccess-file/30818 "2024-02-17T08:53:53Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mritzmann](https://avatars.discourse-cdn.com/v4/letter/m/ecc23a/32.png) [@mritzmann](https://forum.getkirby.com/u/mritzmann)\
**Post date:** [February 17, 2024, 8:53am UTC](https://forum.getkirby.com/t/who-manages-the-htaccess-file/30818/1 "2024-02-17T08:53:53Z")

</div>

Hi 👋

I set up my Kirby website a few years ago. I am not very familiar with web development and used the starterkit. Below is the Composer file that is currently in use.

> **composer.json**
>
> ```json
> {
> "name": "getkirby/starterkit",
> "description": "Kirby Starterkit",
> "type": "project",
> "keywords": ["kirby", "cms", "starterkit"],
> "homepage": "https://getkirby.com",
> "authors": [
> {
> "name": "Bastian Allgeier",
> "email": "bastian@getkirby.com",
> "homepage": "https://getkirby.com"
> }
> ],
> "support": {
> "email": "support@getkirby.com",
> "issues": "https://github.com/getkirby/starterkit/issues",
> "forum": "https://forum.getkirby.com",
> "source": "https://github.com/getkirby/starterkit"
> },
> "require": {
> "php": ">=7.1.0",
> "getkirby/cms": "^4.0",
> "sylvainjule/bouncer": "^1.0"
> },
> "config": {
> "optimize-autoloader": true,
> "allow-plugins": {
> "getkirby/composer-installer": true
> }
> }
> }
> 
> ```

Now I would like to migrate the website from Nginx to Apache. For this reason, I need a `.htaccess` file in the webroot so that the URLs are resolved correctly and certain URLs (e.g. access to `content`) are blocked. After running `composer install`, however, no such `.htaccess` file is created. For this reason I used the `.htaccess` file (created manually) from [getkirby/starterkit](https://github.com/getkirby/starterkit/blob/main/.htaccess), everything works fine.

Now to my question: Is it correct that I have to create and maintain the `.htaccess` file manually (Check after each update whether it is still up to date) or should it have been created by Composer?

The [documentation](https://getkirby.com/docs/guide/troubleshooting/installation) says:

> Make sure that the `.htaccess` file that ships with Kirby is present in your Kirby folder.

Best,  
Markus

---

<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:** [February 17, 2024, 9:12am UTC](https://forum.getkirby.com/t/who-manages-the-htaccess-file/30818/2 "2024-02-17T09:12:59Z")

</div>

No, composer doesn’t create a `.htaccess` file. In fact, the `.htaccess` file in the Starterkit is just there to provide a best-practice example.

In cases where you manage the server yourself, you would not use the `.htaccess` file but move the directives contained in there to your server config file.

Also, the `.htaccess` file is only relevant for Apache web servers. For all other web server, including Nginx, it is of no use, and you would have to create similar rules in your nginx.conf file.

See also [Running Kirby on a Nginx web server | Kirby CMS](https://getkirby.com/docs/cookbook/setup/nginx)

---

<div class="post-metadata">

**Author:** ![mritzmann](https://avatars.discourse-cdn.com/v4/letter/m/ecc23a/32.png) [@mritzmann](https://forum.getkirby.com/u/mritzmann)\
**Post date:** [February 17, 2024, 10:15am UTC](https://forum.getkirby.com/t/who-manages-the-htaccess-file/30818/3 "2024-02-17T10:15:19Z")

</div>

I’m aware that I have to manage the web server configuration for Nginx myself (that’s what I’m currently doing). Your answer also answered my question about `.htaccess` file, thank you!
