.htaccess with Jekyll 4.2.2

Hello, how can i generate a .htaccess with Jekyll 4.2.2 ?

Thank you
steveng

are you using an apache server? what is your issue exactly? you should be able to include an htaccess file in the root by adding it to the include list in the config file.

i"m not sure what you mean by generate an htaccess file, jekyll doesn’t know what one is.

git clone https://github.com/jeromelachaud/freelancer-theme.git
Klone nach 'freelancer-theme' ...
remote: Enumerating objects: 1007, done.
remote: Counting objects: 100% (6/6), done.
remote: Total 1007 (delta 5), reused 5 (delta 5), pack-reused 1001
Empfange Objekte: 100% (1007/1007), 4.41 MiB | 1.23 MiB/s, fertig.
Löse Unterschiede auf: 100% (512/512), fertig.


cd freelancer-theme
bundle exec jekyll serve --open-url --livereload  ### It works with FireFox

#######
tree
.
├── _config.yml
├── css
│   └── font-awesome
│       ├── css
│       │   ├── font-awesome.css
│       │   └── font-awesome.min.css
│       └── fonts
│           ├── FontAwesome.otf
│           ├── fontawesome-webfont.eot
│           ├── fontawesome-webfont.svg
│           ├── fontawesome-webfont.ttf
│           └── fontawesome-webfont.woff
├── feed.xml
├── freelancer-theme-jekyll.gemspec
├── Gemfile
├── Gemfile.lock
├── img
│   ├── portfolio
│   │   ├── cabin.png
│   │   ├── cake.png
│   │   ├── circus.png
│   │   ├── game.png
│   │   ├── safe.png
│   │   └── submarine.png
│   └── profile.png
├── _includes
│   ├── about.html
│   ├── contact_disqus.html
│   ├── contact.html
│   ├── contact_static.html
│   ├── css
│   │   ├── bootstrap.min.css
│   │   └── main.css
│   ├── footer.html
│   ├── header.html
│   ├── head.html
│   ├── js_disqus.html
│   ├── js.html
│   ├── modals.html
│   ├── nav.html
│   └── portfolio_grid.html
├── index.html
├── js
│   ├── bootstrap.js
│   ├── bootstrap.min.js
│   ├── cbpAnimatedHeader.js
│   ├── cbpAnimatedHeader.min.js
│   ├── classie.js
│   ├── contact_me.js
│   ├── contact_me_static.js
│   ├── freelancer.js
│   ├── jqBootstrapValidation.js
│   ├── jquery-1.11.0.js
│   └── jquery.easing.min.js
├── _layouts
│   ├── default.html
│   └── style.css
├── LICENCE
├── mail
│   └── contact_me.php
├── _posts
│   ├── 2014-07-13-project-6.markdown
│   ├── 2014-07-14-project-5.markdown
│   ├── 2014-07-15-project-4.markdown
│   ├── 2014-07-16-project-3.markdown
│   ├── 2014-07-17-project-2.markdown
│   └── 2014-07-18-project-1.markdown
├── Rakefile
├── README.md
├── screenshot.png
├── _site
│   ├── css
│   │   └── font-awesome
│   │       ├── css
│   │       │   ├── font-awesome.css
│   │       │   └── font-awesome.min.css
│   │       └── fonts
│   │           ├── FontAwesome.otf
│   │           ├── fontawesome-webfont.eot
│   │           ├── fontawesome-webfont.svg
│   │           ├── fontawesome-webfont.ttf
│   │           └── fontawesome-webfont.woff
│   ├── feed.xml
│   ├── freelancer-theme-jekyll.gemspec
│   ├── img
│   │   ├── portfolio
│   │   │   ├── cabin.png
│   │   │   ├── cake.png
│   │   │   ├── circus.png
│   │   │   ├── game.png
│   │   │   ├── safe.png
│   │   │   └── submarine.png
│   │   └── profile.png
│   ├── index.html
│   ├── js
│   │   ├── bootstrap.js
│   │   ├── bootstrap.min.js
│   │   ├── cbpAnimatedHeader.js
│   │   ├── cbpAnimatedHeader.min.js
│   │   ├── classie.js
│   │   ├── contact_me.js
│   │   ├── contact_me_static.js
│   │   ├── freelancer.js
│   │   ├── jqBootstrapValidation.js
│   │   ├── jquery-1.11.0.js
│   │   └── jquery.easing.min.js
│   ├── LICENCE
│   ├── mail
│   │   └── contact_me.php
│   ├── Rakefile
│   ├── README.md
│   ├── screenshot.png
│   └── style.css
└── style.css

21 directories, 93 files
######

Local works the site.

Than i have pushed the Files to my host service with FileZilla.

Now i need a “.htaccess”.

Edit

jekyll build

tree
.
├── _config.yml
├── css
│   └── font-awesome
│       ├── css
│       │   ├── font-awesome.css
│       │   └── font-awesome.min.css
│       └── fonts
│           ├── FontAwesome.otf
│           ├── fontawesome-webfont.eot
│           ├── fontawesome-webfont.svg
│           ├── fontawesome-webfont.ttf
│           └── fontawesome-webfont.woff
├── feed.xml
├── freelancer-theme-jekyll.gemspec
├── Gemfile
├── Gemfile.lock
├── img
│   ├── portfolio
│   │   ├── cabin.png
│   │   ├── cake.png
│   │   ├── circus.png
│   │   ├── game.png
│   │   ├── safe.png
│   │   └── submarine.png
│   └── profile.png
├── _includes
│   ├── about.html
│   ├── contact_disqus.html
│   ├── contact.html
│   ├── contact_static.html
│   ├── css
│   │   ├── bootstrap.min.css
│   │   └── main.css
│   ├── footer.html
│   ├── header.html
│   ├── head.html
│   ├── js_disqus.html
│   ├── js.html
│   ├── modals.html
│   ├── nav.html
│   └── portfolio_grid.html
├── index.html
├── js
│   ├── bootstrap.js
│   ├── bootstrap.min.js
│   ├── cbpAnimatedHeader.js
│   ├── cbpAnimatedHeader.min.js
│   ├── classie.js
│   ├── contact_me.js
│   ├── contact_me_static.js
│   ├── freelancer.js
│   ├── jqBootstrapValidation.js
│   ├── jquery-1.11.0.js
│   └── jquery.easing.min.js
├── _layouts
│   ├── default.html
│   └── style.css
├── LICENCE
├── mail
│   └── contact_me.php
├── _posts
│   ├── 2014-07-13-project-6.markdown
│   ├── 2014-07-14-project-5.markdown
│   ├── 2014-07-15-project-4.markdown
│   ├── 2014-07-16-project-3.markdown
│   ├── 2014-07-17-project-2.markdown
│   └── 2014-07-18-project-1.markdown
├── Rakefile
├── README.md
├── screenshot.png
├── _site
│   ├── css
│   │   └── font-awesome
│   │       ├── css
│   │       │   ├── font-awesome.css
│   │       │   └── font-awesome.min.css
│   │       └── fonts
│   │           ├── FontAwesome.otf
│   │           ├── fontawesome-webfont.eot
│   │           ├── fontawesome-webfont.svg
│   │           ├── fontawesome-webfont.ttf
│   │           └── fontawesome-webfont.woff
│   ├── feed.xml
│   ├── freelancer-theme-jekyll.gemspec
│   ├── img
│   │   ├── portfolio
│   │   │   ├── cabin.png
│   │   │   ├── cake.png
│   │   │   ├── circus.png
│   │   │   ├── game.png
│   │   │   ├── safe.png
│   │   │   └── submarine.png
│   │   └── profile.png
│   ├── index.html
│   ├── js
│   │   ├── bootstrap.js
│   │   ├── bootstrap.min.js
│   │   ├── cbpAnimatedHeader.js
│   │   ├── cbpAnimatedHeader.min.js
│   │   ├── classie.js
│   │   ├── contact_me.js
│   │   ├── contact_me_static.js
│   │   ├── freelancer.js
│   │   ├── jqBootstrapValidation.js
│   │   ├── jquery-1.11.0.js
│   │   └── jquery.easing.min.js
│   ├── LICENCE
│   ├── mail
│   │   └── contact_me.php
│   ├── Rakefile
│   ├── README.md
│   ├── screenshot.png
│   └── style.css
└── style.css

21 directories, 93 files

but what is your issue? do you have an htaccess file but jekyll isn’t copying it to the site folder?

or are you trying to get jekyll to make one for you? it won’t.

If you add a .htaccess file to the root of your project it probably won’t copy to the site folder until you change the config file to include it - files that start with a period are ignored by default I think.

Hello, i have this files:

or are you trying to get jekyll to make one for you? it won’t.

Thank you, that i didn’t know.

How ca i create a .htacces for my hosting space?

Greetz
steveng

You write one and place it in your “top” directory. BTW: one doesn’t really need one. But here are a few lines of mine:

#################################
# enable GZIP
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE application/xml
AddOutputFilter DEFLATE sj j cib js css
AddOutputFilter DEFLATE obj plist
AddOutputFilter DEFLATE jpg jpeg giv ico webp
#################################