advanced redirection for different protocols

New to mod_rewrite? This is a good place to start.

advanced redirection for different protocols

Postby BMN » Fri Oct 02, 2009 2:15 am

How to redirect all traffic to any server?

For HTTP (which is on port 80) I wrote this in .htaccess:
Code: Select all
RewriteEngine on
RewriteCond %{HTTP_HOST} ^sub.domain.com$ [OR]
RewriteCond %{HTTP_HOST} ^www.sub.domain.com$
RewriteRule ^(.*)$ http://dest.address.com [R=301,L]

RedirectMatch permanent ^/sub/$ http://dest.address.com

But how to redirect others protocols, running on other ports to different external servers?
SIP (port 5060) to serwer1
SMTP (port 25) to serwer2
Telnet (port 23) to serwer3
BMN
 
Posts: 39
Joined: Wed Jul 05, 2006 2:15 am

Postby richardk » Fri Oct 02, 2009 4:16 am

Not with mod_rewrite. Mod_rewrite only works on HTTP(S) requests.

Even if Apache was listening on the other ports, it would send a HTTP redirect which the non-HTTP clients are unlikely to understand it.
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am

Postby BMN » Fri Oct 02, 2009 5:03 am

So should I contact with the hosting supplier to help me with it? :(
BMN
 
Posts: 39
Joined: Wed Jul 05, 2006 2:15 am

Postby richardk » Sat Oct 03, 2009 8:15 am

You can ask them, but i'm not sure it's even possible.
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am


Return to Beginner's Corner

Who is online

Users browsing this forum: No registered users and 21 guests

cron