meine
meine 🌒 - A CLI file manager and system utility built with Textual. It combines intuitive command parsing with rich t…
Python★ 50
Convert .htaccess redirects to nginx.conf redirects
git clone https://github.com/lukechilds/htconvert.gitlukechilds/htconvertConvert .htaccess redirects to nginx.conf redirects.
npm install --global htconvert
$ cat .htaccess | htconvert > nginxRedirects.conf # or $ htconvert -f .htaccess > nginxRedirects.conf
.htaccess
# Frontend Redirects Redirect 301 /deleted-page/ https://website.com/new-page/ Redirect 302 /new-feature/ https://website.com/coming-soon/ # Admin Redirects Redirect 301 /admin/ https://website.com/?login=true
nginxRedirects.conf
# Frontend Redirects
location /deleted-page/ {
return 301 https://website.com/new-page/;
}
location /new-feature/ {
return 302 https://website.com/coming-soon/;
}
# Admin Redirects
location /admin/ {
return 301 https://website.com/?login=true;
}
$ htconvert --help
Usage: htconvert [options]
Options:
-h, --help output usage information
-V, --version output the version number
-f, --file [.htaccess] File containing .htaccess redirects
This is also usable as a node module
npm install --save htconvert
var htconvert = require('htconvert');
var htaccess = 'Redirect 301 /deleted-page/ https://website.com/new-page/';
htconvert(htaccess);
// `location /deleted-page/ {
// return 301 https://website.com/new-page/;
// }`
MIT © Luke Childs
more like this
meine 🌒 - A CLI file manager and system utility built with Textual. It combines intuitive command parsing with rich t…
search projects, people, and tags