1.1.8 • Published 5 years ago

apache2redirects v1.1.8

Weekly downloads
2
License
ISC
Repository
github
Last release
5 years ago

Apache2Redirects

Yoru file in Apache2

Redirect 301 "/kool/faa-fuu-foo" "/kool/faa-fuu"
Redirect 301 "/kool/blass-fuu-foo" "/kool/hee-fuu"
Redirect 301 "/kool/hee-fuu-jao" "/kool/hee-fuu"
Redirect 301 "/url/ bla " "/url/bla"
Redirect 301 "/url/ foo" "/url/foo"
Redirect 301 "/kool/bla-buu-space" "/kool/bla-buu"
Redirect 301 "/kool/foo" "/kool/foo-el-recomendador"
RedirectMatch 301 ^\/me-url\/and(.*)?\/?$ /other/$1
RedirectMatch 301 ^\/foo\/bar(.*)?\/?$ /go-to/$1
Redirect 301 "/url/foo" "/url#foo"

In Expressjs

const express = require('express');
const apache2 = require('Apache2Redirects')({
  source : {
    // URL
    http : 'http://apache2.kool/redirect',
    //File system
    file : '../apache2/redirect.conf',
    // Internal
    internal : [{
      regexp : "/my-kool-rediection",
      to : "/end-redirection", 
      status : '301'
    }]
  }
});

var app = express();

app.use(apache2.use);
app.post('/redirect', (req, res) => res.json(req.Httpd(req.body.url)));

Options

  • source: Is a object with url or elements to redirect
  • flags : Is flags in RegExp
  • next : Is the result when is NOT in file redirections
  • useRedirect : Use res.redirect the expressjs
  • check : Is a functions, is return a Boolean, and arguments is the Headers of the file.

That's all!!

1.1.8

5 years ago

1.1.7

5 years ago

1.1.6

5 years ago

1.1.5

5 years ago

1.1.4

5 years ago

1.1.3

5 years ago

1.1.2

5 years ago

1.1.1

5 years ago

1.0.10

5 years ago

1.0.9

5 years ago

1.0.8

5 years ago

1.0.7

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago