Watch
1
0
Fork
You've already forked arc
0
forked from hesabix/arc
arc/extraScripts/telegram_proxy/.htaccess

33 lines
1.3 KiB
ApacheConf

# تنظیمات پروکسی تلگرام برای cPanel
# این فایل باید در root domain شما قرار بگیرد (همان جایی که index.php است)
RewriteEngine On
# مسدود کردن صفحات تست/دیباگ عمومی (حتی اگر فایل روی دیسک مانده باشد)
RewriteRule ^(test_webhook|set_webhook_test|test_connection)\.php$ - [F,L,NC]
RewriteRule ^CONFIG_FIXED_EXAMPLE\.php$ - [F,L,NC]
RewriteRule ^config\.example\.php$ - [F,L,NC]
# هدایت مسیر /telegram/webhook به index.php
RewriteCond %{REQUEST_URI} ^/telegram/webhook$ [NC]
RewriteCond %{REQUEST_METHOD} POST [NC]
RewriteRule ^(.*)$ index.php [QSA,L]
# هدایت مسیر /telegram/send به index.php
RewriteCond %{REQUEST_URI} ^/telegram/send$ [NC]
RewriteCond %{REQUEST_METHOD} POST [NC]
RewriteRule ^(.*)$ index.php [QSA,L]
# هدایت مسیر /health به index.php
RewriteCond %{REQUEST_URI} ^/health$ [NC]
RewriteCond %{REQUEST_METHOD} GET [NC]
RewriteRule ^(.*)$ index.php [QSA,L]
# هدایت مسیر /telegram/webhook/status به index.php
RewriteCond %{REQUEST_URI} ^/telegram/webhook/status$ [NC]
RewriteCond %{REQUEST_METHOD} GET [NC]
RewriteRule ^(.*)$ index.php [QSA,L]
# اطمینان از اینکه index.php در دسترس است
DirectoryIndex index.php