Skip to content

tlvince/gen301

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 

gen301

Generate HTTP 301 redirect rules from URL lists and filenames.

From a supported input format of URLs, fuzzy search a directory for filenames that are a sub-string of a URL and output a mapping in one of the supported output formats to stdout.

Input formats

An input format can be one (or any) of:

  • Google Webmaster Tools crawl errors CSV file
  • A newline separated list of URLs

Output formats

  • rack-rewrite 301 static redirect
  • Comma separated list

Examples

$ gen301 -use \
    --gcsv /tmp/Web_crawl_error_sources_www_tlvince_com_20110711T030411Z.csv" \
    --plain /tmp/disqus-urls.csv \
    --dirs ~/proj/blog/journal/entry \
    --output rack | sort > /tmp/301s

... which generated these redirects in production.

About

Generate HTTP 301 redirect rules from URL lists and filenames

Resources

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

 

Packages

No packages published

Languages