htaccess-rewrite-rule-generator

    0.1.1 • Public • Published

    htaccess-rewrite-rule-generator

    npm version Dependencies Build Status Code Coverage

    Usage

    var rewriteRuleGenerator = require('htaccess-rewrite-rule-generator');
    // The generator is curried
    var myGenerator = rewriteRuleGenerator({
      type: '301' // 301 or queryString
    });
    // Output is an either from sanctuary.
    myGenerator('http://www.myhost.com/old/path/', 'http://www.myhost.com/new/path/');
    //> S.Right("RewriteRule ^/old/path/$ /new/path/? [L,R=301]")
    myGenerator('invalidUrl', 'http://www.myhost.com/new/path/');
    //> S.Left("invalidUrl is not a valid URL.")

    Keywords

    none

    Install

    npm i htaccess-rewrite-rule-generator

    DownloadsWeekly Downloads

    3

    Version

    0.1.1

    License

    GPLv2

    Last publish

    Collaborators

    • swordbeta