FlinkTools

.gitignore and redirect rules

Pick your stack and get a .gitignore, or write redirects once and get them for nginx, Apache .htaccess and Cloudflare _redirects.

Processed on your device, never uploaded

.gitignore

Part
Templates

.gitignore

Based on the github/gitignore templates (CC0), shortened to the common entries.

.gitignore from 2 template(s), 39 lines.Processed on your device, never uploaded

What it does

Two small jobs every developer repeats. The .gitignore part builds a file from templates for Node, Python, Java, Go, Rust, PHP, Ruby, .NET, Swift, Android, Dart, Terraform, macOS, Windows, Linux, JetBrains, VS Code and Vim, based on the github/gitignore collection, and you can add your own lines. The redirect part takes one rule per line, from, to and an optional status, and writes it as nginx location blocks, Apache .htaccess lines or a Cloudflare _redirects file. It supports wildcards for whole folders and warns about loops, chains, duplicates and bad lines. It runs in your browser.

How to use it

  1. 1Choose .gitignore or Redirect rules.
  2. 2Pick templates, or write one redirect per line.
  3. 3Copy the result or download the file.

Common uses

  • Start a new project with a correct .gitignore for your language and editor.
  • Combine templates, for example Node, macOS and VS Code.
  • Move a site and redirect the old URLs to the new ones with a 301.
  • Get the same redirect list as nginx, .htaccess and Cloudflare for a host change.
  • Find redirect loops and chains before they hurt your SEO.

Questions

Where does the .gitignore go?

In the root folder of your repository, or in a subfolder for rules that apply only there. Files already tracked by Git stay tracked until you remove them from the index.

Where do the templates come from?

They follow the github/gitignore collection (CC0), shortened to the common entries.

What is the difference between 301 and 302?

301 is a permanent move that search engines follow and pass ranking to. 302 is temporary, so the old address stays indexed.

How do wildcards work?

End the source with * to match a folder, for example /blog/*. Use * in the target for the rest of the path: /blog/* to /news/*.

Where do I put the redirect rules?

nginx: inside the server block of your site config. Apache: in the .htaccess file (mod_alias must be on). Cloudflare Pages and Workers assets: a file named _redirects in the output folder.

What is a redirect chain?

A to B and B to C. Every extra step slows the page and loses a little SEO value. Point A straight at C.

Is anything uploaded?

No. The file is built in your browser.

AD320 × 100