Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > Web forwarding.

Web forwarding.
Thread Tools
kick52
Baninated
Join Date: May 2005
Location: England
Status: Offline
Reply With Quote
Oct 24, 2006, 02:52 PM
 
Hi.

I'm hosting some of my stuff on my PowerMac G4, with a dynamic IP.

I haven't got a domain name registered especially for that, but i do have another website with cPanel.

Is there a way to fully redirect someone to my PowerMac using a sub-domain?

When I say fully redirect, I mean redirect to my address given to me by my IP, but with the path i entered:

so "http://sub-domain.domain.com/Files/File" goes to "http://powermachostname.co.uk/Files/File"


Can anyone help me out?
I tried DynDNS, but I would like to have something like this on my own website.
I tried a PHP script, but it won't work when posting to forums and things.

Any help is *great*,
Tim
     
RAILhead
Addicted to MacNN
Join Date: Mar 2001
Location: USA
Status: Offline
Reply With Quote
Oct 24, 2006, 03:13 PM
 
I'd turn on web sharing, organize stuff like that on the G4, then use DynDNS. I used to do that all the time until my bandwidth killed my connection.
"Everything's so clear to me now: I'm the keeper of the cheese and you're the lemon merchant. Get it? And he knows it.
That's why he's gonna kill us. So we got to beat it. Yeah. Before he let's loose the marmosets on us."
my bandmy web sitemy guitar effectsmy photosfacebookbrightpoint
     
kick52  (op)
Baninated
Join Date: May 2005
Location: England
Status: Offline
Reply With Quote
Oct 24, 2006, 03:16 PM
 
Originally Posted by RAILhead View Post
I'd turn on web sharing, organize stuff like that on the G4, then use DynDNS. I used to do that all the time until my bandwidth killed my connection.

yeah, i can do that, but i wondered if there is a way to do this on my own webspace.
     
turtle777
Clinically Insane
Join Date: Jun 2001
Location: planning a comeback !
Status: Offline
Reply With Quote
Oct 24, 2006, 06:05 PM
 
Well, can't you just forward your own subdomain to the DynDNS addrress ?

-t
     
kick52  (op)
Baninated
Join Date: May 2005
Location: England
Status: Offline
Reply With Quote
Oct 24, 2006, 06:16 PM
 
no, because the only redirection that cpanel can do is without path forwarding.

i just found this, its a longshot,, but will this help me?
Dnsmasq - a DNS forwarder for NAT firewalls.
     
skalie
Mac Elite
Join Date: Mar 2002
Location: Clogland
Status: Offline
Reply With Quote
Oct 24, 2006, 09:30 PM
 
Originally Posted by kick52 View Post
Hi.
I tried a PHP script, but it won't work when posting to forums and things.
Er, if I understand correctly.........

............. link from the forum to the script ( 301 redirect by any chance? ), which in turn redirects to the url you want the visitor to end up at.

( if I understood correctly )
     
besson3c
Clinically Insane
Join Date: Mar 2001
Location: yes
Status: Offline
Reply With Quote
Oct 24, 2006, 10:43 PM
 
Originally Posted by kick52 View Post
yeah, i can do that, but i wondered if there is a way to do this on my own webspace.


Not without running your own DNS service, and I believe you'd need root to start the named (DNS) daemon.
     
besson3c
Clinically Insane
Join Date: Mar 2001
Location: yes
Status: Offline
Reply With Quote
Oct 24, 2006, 10:45 PM
 
Originally Posted by kick52 View Post
Hi.

I'm hosting some of my stuff on my PowerMac G4, with a dynamic IP.

I haven't got a domain name registered especially for that, but i do have another website with cPanel.

Is there a way to fully redirect someone to my PowerMac using a sub-domain?

When I say fully redirect, I mean redirect to my address given to me by my IP, but with the path i entered:

so "http://sub-domain.domain.com/Files/File" goes to "http://powermachostname.co.uk/Files/File"


Can anyone help me out?
I tried DynDNS, but I would like to have something like this on my own website.
I tried a PHP script, but it won't work when posting to forums and things.

Any help is *great*,
Tim

What did your PHP script do? Redirect to your subdomain? Your forum will work once visitors are redirected to your subdomain, as long as your subdomain is used within your forum prefs/config.

I'm not sure I'm understanding you though.
     
kick52  (op)
Baninated
Join Date: May 2005
Location: England
Status: Offline
Reply With Quote
Oct 25, 2006, 04:04 AM
 
Originally Posted by skalie View Post
Er, if I understand correctly.........

............. link from the forum to the script ( 301 redirect by any chance? ), which in turn redirects to the url you want the visitor to end up at.

( if I understood correctly )
ok.

i made an .htaccess file which handles 404s by a PHP script. This php script (incorrectly) finds out what address you were trying to visit. It then snips out the domain name at the start and puts my macs hostname in there (There is a script on my mac which uploads its hostname, and that script reads it.)

The thing is, it worked when i typed an address into the address bar, but if it has a link, it would do crazy stuff like put the place you were visiting from infront of my hostname..
Also, pictures don't work when put in one of my messages.



It would be good if there was a way to do this in cPanel, but cPanel doesnt offer variable targets.
     
skalie
Mac Elite
Join Date: Mar 2002
Location: Clogland
Status: Offline
Reply With Quote
Oct 25, 2006, 04:12 AM
 
Sorry once again, if I'm over simplifying, but just in case you are getting unnecessarily complicated.... ( using the links from your first post )

In http://sub-domain.domain.com/Files/File make an index.php with only this as the code.

Code:
<?php Header( "HTTP/1.1 301 Moved Permanently" ); Header( "Location: http://powermachostname.co.uk/Files/File" ); ?>
Er, if you want to make it look like you are still in domain.com, you could use a frameset maybe? *ducks for cover*
     
kick52  (op)
Baninated
Join Date: May 2005
Location: England
Status: Offline
Reply With Quote
Oct 25, 2006, 04:24 AM
 
yes... thats all well and good.. but it wouldnt work if i had more than one file in that folder.
because it would direct all to http://sub-domain.domain.com/Files/File.
     
besson3c
Clinically Insane
Join Date: Mar 2001
Location: yes
Status: Offline
Reply With Quote
Oct 25, 2006, 08:56 AM
 
Originally Posted by kick52 View Post
yes... thats all well and good.. but it wouldnt work if i had more than one file in that folder.
because it would direct all to http://sub-domain.domain.com/Files/File.

Put a redirect in an .htaccess file located at your DocRoot (base of your website). This should work to redirect everything in a directory.
     
kick52  (op)
Baninated
Join Date: May 2005
Location: England
Status: Offline
Reply With Quote
Oct 25, 2006, 01:02 PM
 
Originally Posted by besson3c View Post
Put a redirect in an .htaccess file located at your DocRoot (base of your website). This should work to redirect everything in a directory.
i dont get what you mean...

i have an htaccess in the subdomain that works fine..

but i dont get how i get it to redirect everything.. with a wildcard?
     
besson3c
Clinically Insane
Join Date: Mar 2001
Location: yes
Status: Offline
Reply With Quote
Oct 25, 2006, 01:55 PM
 
Originally Posted by kick52 View Post
i dont get what you mean...

i have an htaccess in the subdomain that works fine..

but i dont get how i get it to redirect everything.. with a wildcard?

Redirect Visitors To a New Page or Site - HTML Tips and Tricks

Check out the "move an entire site" section.
     
kick52  (op)
Baninated
Join Date: May 2005
Location: England
Status: Offline
Reply With Quote
Oct 25, 2006, 05:50 PM
 
Originally Posted by besson3c View Post
Redirect Visitors To a New Page or Site - HTML Tips and Tricks

Check out the "move an entire site" section.
that looks like what i need but how can i add a php variable inside a .htaccess file? because i am on a dynamic IP...
     
besson3c
Clinically Insane
Join Date: Mar 2001
Location: yes
Status: Offline
Reply With Quote
Oct 25, 2006, 05:55 PM
 
Originally Posted by kick52 View Post
that looks like what i need but how can i add a php variable inside a .htaccess file? because i am on a dynamic IP...

Why would your IP address or the fact you're on a dynamic IP matter, as long as the DNS name resolved to the correct IP? Have you been using your IP address to access these pages with? If so, sounds like a DNS entry is the way to go.

What is your setup like? Can you create DNS entries on the machine authoritative over your base level domain? If not, have you looked at dyndns.org?
     
kick52  (op)
Baninated
Join Date: May 2005
Location: England
Status: Offline
Reply With Quote
Oct 25, 2006, 06:00 PM
 
UPDATE:

my good friend hawken on IRC told me that i could write out to the htaccess file and be able to put the IP in there.

thanks hawken!
     
besson3c
Clinically Insane
Join Date: Mar 2001
Location: yes
Status: Offline
Reply With Quote
Oct 25, 2006, 06:45 PM
 
Originally Posted by kick52 View Post
UPDATE:

my good friend hawken on IRC told me that i could write out to the htaccess file and be able to put the IP in there.

thanks hawken!

That works too, but you'll have to update this file every time your IP changes. I suppose this is actually better than the DNS record, so long as you don't mind exposing the IP address. A DNS record would be cached for a while.
     
kick52  (op)
Baninated
Join Date: May 2005
Location: England
Status: Offline
Reply With Quote
Oct 26, 2006, 09:37 AM
 
Originally Posted by besson3c View Post
That works too, but you'll have to update this file every time your IP changes. I suppose this is actually better than the DNS record, so long as you don't mind exposing the IP address. A DNS record would be cached for a while.
well i got lingon to schedule a script.. so that should work.

if you want to test and see the results go here:

Index of /
     
besson3c
Clinically Insane
Join Date: Mar 2001
Location: yes
Status: Offline
Reply With Quote
Oct 26, 2006, 10:15 AM
 
Cool! Glad to hear that you've come up with a solution that works for you
     
   
 
Forum Links
Forum 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
Top
Privacy Policy
All times are GMT -4. The time now is 09:37 PM.
All contents of these forums © 1995-2017 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.8 © 2000-2017, Jelsoft Enterprises Ltd.,