Menu icon Foundation

Where can i put a htaccess file? So it then being copyied to the finish site folders?


Where can i put a htaccess file? So it then being copyied to the finish site folders?

Arthur Jones over 1 year ago

These .htaccess files can be used to alter the configuration of the Apache Web Server software to enable/disable additional functionality and features that the Apache Web Server software has to offer. Chase Bank Login

Lucy Holt about 2 years ago

Thanks for your reply. Really helped me too!

Kester Hynds about 2 years ago

In Zurb Foundation 6 you need to edit `gulpfile.babel.js`. Then you can add an `.htaccess` file in the src folder and it will get copied across. N.B. You still need to get your `.htaccess` syntax correct!

1. Create a new function (e.g. add it below copy function):

// Copy .htaccess
function htaccess() {
  return gulp.src('src/.htaccess')


2. Add `htaccess` to the build task:

// Build the "dist" folder by running all of the below tasks
 gulp.series(clean, gulp.parallel(pages, sass, javascript, images, copy, htaccess), styleGuide));


3. Add a watch task to the `watch` function:


// Watch for changes to static assets, pages, Sass, and JavaScript
function watch() {, copy);'src/.htaccess', htaccess);'src/pages/**/*.html').on('all', gulp.series(pages, browser.reload));'src/{layouts,partials}/**/*.html').on('all', gulp.series(resetPages, pages, browser.reload));'src/assets/scss/**/*.scss').on('all', sass);'src/assets/js/**/*.js').on('all', gulp.series(javascript, browser.reload));'src/assets/img/**/*').on('all', gulp.series(images, browser.reload));'src/styleguide/**').on('all', gulp.series(styleGuide, browser.reload));

Matthew Wall almost 4 years ago

Has anyone successfully used this to redirect a page yet?

.htaccess has been copied the root dist folder correctly and I have a single line:

Redirect 301 /google.html


google.html shows Cannot GET /google.html


Doesn't seem to work!

Geoff Kimball almost 4 years ago

You'll have to add a little extra code, because the structure of the project is fairly rigid.

Find the copy task in the gulpfile.js and add this at the top of the function, above the existing code:


That will copy .htaccess from the root of your src folder to the root of your dist folder.

Jonas almost 4 years ago

ZURB Template

Geoff Kimball almost 4 years ago

Which starter project are you using? The Basic Template or ZURB Template?