Workaround for port restriction / mod_rewrite?


#1

Hello!

My ISP blocks the 80 port so I cannot host my web site (Java) neither on Dreamhost (simple plan) nor at my home directly (I need the port 99 for example). I’ve tried to use mod_rewrite like this but I get a “400 Bad Request” response:

Options +FollowSymLinks RewriteEngine On # RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ http://xyz.dyndns.org:99/$1 [PT,L]

Any idea? Alternative?


#2

It might be worth trying to forward visitors to your xyz.dyndns.org address and have it setup over at dyndns to be a Webhop Redirect which contains your home IP:port details.

Info here: https://www.dyndns.com/support/kb/webhops_redirections.html#ports

Maximum Cash Discount on any plan with MAXCASH

How To Install PHP.INI / ionCube on DreamHost


#3

Thank you for your reply sXi.

What I’m looking for is to have the visitor virtually always at “my-site.com” (@Dreamhost), not “xyz.dyndns.org:99”. Particularly I’m trying to avoid him to see any unconventional port in his address bar. If my understanding is correct, with the WebHop stuff, we’ll see it, isn’t it?


#4

I think dyndns has the ability to cloak an address, although I’ve only ever used dyndns for easy access to TeamSpeak servers (easier to remember something like ts.ath.cx than a string of numbers like 123.223.122.112:8676 when someone asks for the addy).

Maximum Cash Discount on any plan with MAXCASH

How To Install PHP.INI / ionCube on DreamHost


#5

[quote]What I’m looking for is to have the visitor virtually always at “my-site.com” (@Dreamhost), not “xyz.dyndns.org:99”. Particularly I’m trying to avoid him to see any unconventional port in his address bar. If my understanding is correct, with the WebHop stuff, we’ll see it, isn’t it?

[/quote]

Sadly, this is also the case for mod_rewrite. I’m not 100% sure why your rules aren’t working, but they won’t give you any better results.

You can try setting your domain up as a “cloaking” domain (which uses HTML frames to hide the actual address of your site from view), but that has a few caveats. In general, the best approach for this sort of situation is to figure out how to host your whole site at Dreamhost, or to find an ISP that doesn’t block port 80.


#6

Yes, but the cloaking technique just hides the complete URL and what the user see in the address bar remains the site itself, like: xyz.com, with no query string. The actual URL is used by the iframe and during the navigation it is always xyz.com that is displayed atop. You’d never see xyz.com/blog.html for example.

I really cannot afford much more than the simple plan of Dreamhost so, if they were offering some Java plans for peanuts I could go on… :stuck_out_tongue: Now I’m to find a way to redirect some contents to my local server but mod_rewrite leads me to that “Bad Request” thing that I don’t understand.

Thanks for your ideas & help!


#7

Why wouldn’t they give me any better results? Indeed I’m a bit surprised they don’t work. Locally I’ve used this module to redirect some things from Apache HTTP Server to Tomcat (without AJP) and it has worked very well by memory.

I do agree with you for the situation but I cannot afford any costly plan since I’ll not have any money back from my site and my contract with my provider will last 10 months from now… :frowning:


#8

And what about the mod_rewrite documentation? If you sit back and think again you’d probably realize what you want would require a proxy at DreamHost. They don’t offer that - even if you signed up for DreamHost PS mod_proxy support is intended only for local daemons. I don’t know why you’re getting a Bad Request error message, but when trying to re-write to an external URL like that, a redirect should be sent instead. Hence why andrewf said you’re not going to get any better results.

Customer since 2000 :cool: openvein.org


#9

Cloaking doesn’t give you a complete “alias”, and it shouldn’t. If pages are being served from address xyz.dyndyn.org then the browser will inevitably tell the user that that’s where they are. This is actually a good thing :wink:

If you want the ability for people to use your xyz.com address, you could implement a .htaccess 301 redirect to xyz.dyndns.org and have the pages there state that you are still xyz.com via titles, graphics, headers, etc. Try not to concern yourself about what is reported in the address bar of the end user’s browser.

Maximum Cash Discount on any plan with MAXCASH

How To Install PHP.INI / ionCube on DreamHost


#10

Oh, yes, that’s a very good point! I didn’t think about the presence of mod_proxy.

Thanks for your help!


#11

Yes, it seems that I’ll have to make some concessions.

Thanks for your help and ideas sXi! :slight_smile: