Skip to content

tlvince/gen301

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 

Repository files navigation

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