DiscussAdmin Forum Seperator
Advert Left
User CP New PostsFavorites FAQReferrers Web Tools

Web Development This Forum is dedicated to the discussion of all Web Development related discussions.

DiscussAdmin Forum » Web Hosting & Development » Web Development » [URGENT] - .htaccess Domain Masking


Reply
 
LinkBack Thread Tools Display Modes
Junior Member
 
Join Date: May 2009
Posts: 100
iTrader: (0)

leyton is on a distinguished road
Send a message via AIM to leyton Send a message via MSN to leyton

Old 08-28-2009   #1 (permalink)
[URGENT] - .htaccess Domain Masking


Hello,

I have just set up my 12 internet connection in my house to use one of my servers here as a webserver.

However, my ISP (bSkyb) will not give me a static IP, so I am forced to use a DynDNS domain.

What I want to do is make a URL to the DynDNS Domain. Say, for instance, I set up "server.sbw.co.uk", and I want it to go to "sbw.gotdns.org" how can I do that in HTACCESS. The key to what I want is a mask, not a redirect, and not IFRAMES.

So, just to summarise:
- "server.sbw.co.uk" goes to "sbw.gotdns.org"
- HOWEVER, even after the page is viewed on the gotdns.org domain, it still shows up as server.sbw.co.uk

Any ideas, I'd be glad to elaborate further.

Regards,
Leyton Reed
leyton is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
tm0
Banned
 
Join Date: May 2009
Posts: 1,039
iTrader: (0)

tm0 is on a distinguished road
Send a message via MSN to tm0

Old 08-28-2009   #2 (permalink)
RE: [URGENT] - .htaccess Domain Masking

One does any ISP allow it? That may be easier.

I'm not quite sure but does this help?

http://www.webconfs.com/how-to-redirect-a-webpage.php

Sorry if its off.
Tm0
tm0 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Full Member
 
Join Date: Oct 2008
Posts: 608
iTrader: (0)

Myles is on a distinguished road
Send a message via AIM to Myles Send a message via MSN to Myles

Old 08-29-2009   #3 (permalink)
RE: [URGENT] - .htaccess Domain Masking

I don't think this can be done with .htaccess. Assuming you have access to the DNS for both servers, you should be able to just add A records so that they are both the same. If you don't, you could do it with a simple PHP and cURL script:

PHP Code:
<?php
$target_domain 
'sbw.gotdns.org';
$curl curl_init('http://'$target_domain$_SERVER['REQUEST_URL']);
curl_exec($curl);
curl_close($curl);
?>
And I guess this .htaccess (requires mod_rewrite):

Code:
RewriteEngine on
RewriteRule ^*$ index.php
Assuming the first script was named index.php.
Myles is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Junior Member
 
Join Date: May 2009
Posts: 100
iTrader: (0)

leyton is on a distinguished road
Send a message via AIM to leyton Send a message via MSN to leyton

Old 08-29-2009   #4 (permalink)
RE: [URGENT] - .htaccess Domain Masking

Quote:
Originally Posted by Myles
I don't think this can be done with .htaccess. Assuming you have access to the DNS for both servers, you should be able to just add A records so that they are both the same. If you don't, you could do it with a simple PHP and cURL script:

PHP Code:
<?php
$target_domain 
'sbw.gotdns.org';
$curl curl_init('http://'$target_domain$_SERVER['REQUEST_URL']);
curl_exec($curl);
curl_close($curl);
?>
And I guess this .htaccess (requires mod_rewrite):

Code:
RewriteEngine on
RewriteRule ^*$ index.php
Assuming the first script was named index.php.
Thanks Myles, I'll give that a go.

I do have access to both DNS's, however, the IP I would want to give the "A" record is dynamic IP, I cannot really use it.

Any ideas of how I use Dynamic IP's to forward a subdomain on my own domain for free?

Regards,
Leyton Reed
leyton is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.3.0
Copyright ©2007 - 2010. DiscussAdmin.com. All rights reserved.
All times are GMT -4. The time now is 07:16 PM.
Web hosting
Quick Registration
User Name:
Password:
Confirm Password:
Email:
Confirm Email:
Birthday:  
Check to Agree with forum rules 

Login!
Not Registered yet? Click here to do so now!

Advertisements