Redirect expired users to a bill payment page on MikroTik

 /ip pool

add name=Block ranges=123.10.0.0/22

/ppp profile

add local-address=123.10.0.1 name=Block only-one=yes remote-address=Block

/ip firewall filter

add action=accept chain=forward dst-port=53 protocol=tcp src-address=123.10.0.0/22

add action=accept chain=forward dst-port=53 protocol=udp src-address=123.10.0.0/22

add action=drop chain=forward src-address=123.10.0.0/22

/ip firewall nat

add action=redirect chain=dstnat comment=expired.redirect dst-port=80 \

protocol=tcp src-address=123.10.0.0/22 to-ports=8090

add action=redirect chain=dstnat dst-port=80 protocol=udp src-address=\

[123.10.0.0/22](https://123.10.0.0/22) to-ports=8090

add action=redirect chain=dstnat dst-port=443 protocol=tcp src-address=\

[123.10.0.0/22](https://123.10.0.0/22) to-ports=8090

/ip proxy

set enabled=yes max-client-connections=10000 max-server-connections=1 port=\

8090

/ip proxy access

add action=redirect action-data=123.10.0.1:8090 dst-address=!123.10.0.1 \

dst-port=80 src-address=123.10.0.0/22

add action=deny dst-address=0.0.0.0/0 src-address=0.0.0.0/0


এর পরের command


/ip/proxy/reset-html


দিয়ে file টা error.html

এই নামে দিয়ে এই ভাবে আপলোড করে দিলে ওকে


Html page code


<!doctype html>

<html lang="bn">

<head>

<meta charset="utf-8" />

<meta name="viewport" content="width=device-width,initial-scale=1" />

<title>Sreejon Online — Notice (Offline)</title>

<style>

:root{

--bg-start: #dfefff;

--bg-end: #ffffff;

--card-bg: #ffffff;

--accent: #ff6a00;

--accent2: #ff2b2b;

--green: #0aaf4b;

--muted: #444444;

--radius: 18px;

--btn-radius: 36px;

--max-w: 420px;

}

/* Using system font stack for offline use (browsers will pick an available Bengali-capable font locally) */

*{box-sizing:border-box}

html,body{

height:100%;

margin:0;

font-family: "Helvetica Neue", "Arial", "Noto Sans Bengali", "Segoe UI", sans-serif;

background: linear-gradient(180deg, var(--bg-start), var(--bg-end));

display:flex;

align-items:center;

justify-content:center;

padding:24px;

}

.wrap{

width:100%;

max-width:var(--max-w);

padding:6px;

background: linear-gradient(135deg, #ff9966, #ff5e62);

border-radius: calc(var(--radius) + 6px);

box-shadow: 0 10px 28px rgba(0,0,0,0.15);

}

.card{

background: var(--card-bg);

border-radius: var(--radius);

padding:28px 22px;

color:var(--muted);

text-align:center;

box-shadow: 0 6px 12px rgba(0,0,0,0.08);

}

.brand{

font-weight:700;

color: var(--accent2);

font-size:26px;

letter-spacing:0.4px;

margin-bottom:8px;

}

.meta{

color:#666666;

font-size:13px;

margin-bottom:18px;

}

.headline{

color:var(--green);

font-weight:700;

font-size:18px;

margin:8px 0 16px;

}

.salutation{

color:#222222;

font-weight:600;

margin-bottom:12px;

}

.body-text{

color:#333333;

line-height:1.7;

font-size:14px;

margin-bottom:18px;

white-space:pre-line;

}

/* Buttons (not links) */

.btn{

display:inline-block;

background: linear-gradient(135deg, var(--accent), var(--accent2));

color:white;

padding:12px 22px;

border-radius:var(--btn-radius);

font-weight:700;

text-decoration:none;

margin:10px auto;

min-width:220px;

box-shadow: 0 6px 14px rgba(255,43,43,0.18);

transition:transform .12s ease, box-shadow .12s ease;

display:block;

border: none;

cursor: pointer;

font-size:15px;

}

.btn:active{ transform:translateY(1px) }

.btn.small{ min-width:160px; padding:10px 18px; font-size:13px }

.contact-row{

display:flex;

gap:12px;

justify-content:center;

margin-top:10px;

flex-wrap:wrap;

}

.note{

margin-top:18px;

color:#555555;

font-size:13px;

}

.footer{

margin-top:14px;

color:var(--accent2);

font-weight:700;

font-size:13px;

}

/* small toast for copy feedback */

.toast{

position: fixed;

left: 50%;

transform: translateX(-50%) translateY(20px);

bottom: 24px;

background: rgba(0,0,0,0.8);

color: #fff;

padding: 10px 14px;

border-radius: 12px;

font-size: 14px;

opacity: 0;

pointer-events: none;

transition: opacity .18s ease, transform .18s ease;

z-index: 1000;

}

.toast.show{

opacity: 1;

transform: translateX(-50%) translateY(0);

pointer-events: auto;

}

@media (max-width:420px){

.card{ padding:20px; }

.brand{ font-size:22px }

.headline{ font-size:16px }

.btn{ min-width:200px }

}

</style>

</head>

<body>

<div class="wrap">

<div class="card" role="region" aria-label="SreejonOnline.com">

<div class="brand">SreejonOnline.com</div>

<div class="meta" id="datetime">তারিখ লোড হচ্ছে...</div>

<div class="headline">আপনার Wi-Fi ইন্টারনেটের মেয়াদ শেষ।</div>

<div class="salutation">সম্মানিত গ্রাহক,</div>

<div class="body-text">

নির্দিষ্ট সময়ে বিল পরিশোধ না করার কারণে

আপনার Wi-Fi ইন্টারনেটের সংযোগ

বিচ্ছিন্ন হয়েছে। দ্রুত রিচার্জ করুন

এবং নিরবিচ্ছিন্ন Wi-Fi ইন্টারনেট ব্যবহার করুন

</div>

<!-- Buttons instead of hyperlinks; data-tel holds the number for copy/display -->

<button class="btn" type="button" data-tel="01977012426" aria-label="বিকাশ পেমেন্ট নম্বর কপি করুন">

বিকাশ পেমেন্ট: 01977012426

</button>

<div class="contact-row" aria-hidden="false">

<button class="btn small" type="button" data-tel="01851035650" aria-label="বিকাশ সেন্ডমানি নম্বর কপি করুন">

বিকাশ সেন্ডমানি: 01851035650

</button>

<button class="btn small" type="button" data-tel="01977012426 | 01851034650" aria-label="যোগাযোগ নম্বর কপি করুন">

যোগাযোগ: 01977012426 01851034650

</button>

</div>

<div class="note">01321141789।</div>

<div class="footer">২৪/৭ সাপোর্ট — SreejonOnline.com</div>

</div>

</div>

<!-- toast element for feedback -->

<div id="toast" class="toast" role="status" aria-live="polite"></div>

<script>

/* Date/time in Bangla */

function formatBanglaDateTime(){

const days = ["রবিবার","সোমবার","মঙ্গলবার","বুধবার","বৃহস্পতিবার","শুক্রবার","শনিবার"];

const months = ["জানুয়ারি","ফেব্রুয়ারি","মার্চ","এপ্রিল","মে","জুন","জুলাই","আগস্ট","সেপ্টেম্বর","অক্টোবর","নভেম্বর","ডিসেম্বর"];

const now = new Date();

const dayName = days[now.getDay()];

const date = now.getDate();

const monthName = months[now.getMonth()];

const year = now.getFullYear();

let hour = now.getHours();

const minute = String(now.getMinutes()).padStart(2,"0");

const second = String(now.getSeconds()).padStart(2,"0");

const ampm = hour >= 12 ? "পিএম" : "এএম";

hour = hour % 12;

hour = hour ? hour : 12;

return `${dayName}, ${date} ${monthName}, ${year} | ${hour}:${minute}:${second} ${ampm}`;

}

function updateDateTime(){

const el = document.getElementById("datetime");

if(el) el.textContent = formatBanglaDateTime();

}

setInterval(updateDateTime, 1000);

updateDateTime();

/* Copy-to-clipboard + toast feedback (no navigation or tel: links) */

function showToast(message){

const t = document.getElementById("toast");

if(!t) return;

t.textContent = message;

t.classList.add("show");

clearTimeout(t._hideTimeout);

t._hideTimeout = setTimeout(()=> t.classList.remove("show"), 2600);

}

function copyText(text){

if(!navigator.clipboard){

// fallback

const ta = document.createElement('textarea');

ta.value = text;

ta.style.position = 'fixed';

ta.style.left = '-9999px';

document.body.appendChild(ta);

ta.select();

try { document.execCommand('copy'); showToast('নম্বর কপি হয়েছে'); }

catch(e){ showToast('কপি করতে পারিনি — অনুগ্রহ করে ম্যানুয়ালি কপি করুন'); }

document.body.removeChild(ta);

return;

}

navigator.clipboard.writeText(text).then(

()=> showToast('নম্বর কপি হয়েছে'),

()=> showToast('কপি ব্যর্থ — অনুগ্রহ করে ম্যানুয়ালি কপি করুন')

);

}

document.addEventListener('click', function(e){

const btn = e.target.closest('button[data-tel]');

if(btn){

const tel = btn.getAttribute('data-tel') || '';

copyText(tel);

}

});

</script>

</body>

</html>


Redirect expired users to a bill payment page on MikroTik Redirect expired users to a bill payment page on MikroTik Reviewed by RIO IT on 15:51 Rating: 5
Powered by Blogger.