Browse files

Add some UI

  • Loading branch information...
HugoHeneault committed Jan 19, 2016
1 parent dc7c1fb commit f1e890fe335dfe187097deb4c61a41031fe21a1f
Showing with 489 additions and 2 deletions.
  1. +34 −0 app.js
  2. +66 −0 index.php
  3. +3 −2 rew.phps
  4. +386 −0 style.css
34 app.js
@@ -0,0 +1,34 @@
var textarea;
var results;
var loader;
function convertRules() {
if ($(this).data('oldVal') == $(this).val()) {
var rules = $(this).val();
if (rules != '') {
type: 'POST',
data: {rules: rules}
}).done(function (result) {
} else {
$(this).data('oldVal', $(this).val());
$(function () {
textarea = $('#apache').find('textarea');
results = $('#nginx').find('textarea');
loader = $('#loader');
textarea.on('propertychange change click keyup input paste', convertRules).data('oldVal', textarea.val());
@@ -0,0 +1,66 @@
if (!empty($_POST['rules'])) {
error_reporting(E_ALL & ~E_NOTICE);
require_once 'rew.phps';
$RC = new rewriteConf($_POST['rules']);
?><!doctype html>
<html lang="fr">
<meta charset="utf-8">
<title>Rule convertor, convert apache htaccess rewrite rules to nginx rewrite rules automatically</title>
<link href=',100' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="style.css">
<h1>Apache2Nginx rules converter</h1>
<i>attention: not so much beta, but check twice before using!</i>
<article id="apache">
<h2>Apache Rewrite Rules</h2>
<textarea placeholder="Paste your rules here"></textarea>
<div id="loader">
<div class="loader-inner pacman">
<article id="nginx">
<h2>Nginx converted Rules</h2>
<textarea placeholder="The magic will appears there"></textarea>
<strong>Will you make the codes public?</strong>
Please check <a href=""></a> also you can contact from: anil(at)
Yes I accept donations. Please use my paypal account: pp(at)
<strong>Does it supports xxx?</strong>
This page has woozy codes, I dont know try it yourself and see. Backreferances, most of the variables and a
few flags are supported.There are tons of fancy hacks for catching rewrite behavior of apache. As you see, it
highly uses variables for deciding to rewriting and there must be many much errors/unmatched directives.
A converter by Mow - UI by <a href="">OwnWeb</a>
<script src=""></script>
<script src="app.js"></script>
@@ -1,10 +1,10 @@
class rewriteConf {
function __construct($htContent){
$this->htContent = $htContent;
function parseLine($line){
list($cmd,$regex,$rew,$flags) = explode(" ",$line);
@@ -18,6 +18,7 @@ class rewriteConf {
$lines = explode("\n",$this->htContent);
$i = 0;
foreach($lines as $line){
$line = trim($line);
if($line[0] != '#' && !empty($line[0])){
if(strpos($line,"RewriteCond") !== false){
if(!isset($k))$k = 0;
Oops, something went wrong.

0 comments on commit f1e890f

Please sign in to comment.