|
|
Web forwarding.
|
|
|
|
Baninated
Join Date: May 2005
Location: England
Status:
Offline
|
|
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
|
|
|
|
|
|
|
|
|
Addicted to MacNN
Join Date: Mar 2001
Location: USA
Status:
Offline
|
|
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.
|
|
|
|
|
|
|
|
|
Baninated
Join Date: May 2005
Location: England
Status:
Offline
|
|
Originally Posted by RAILhead
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.
|
|
|
|
|
|
|
|
|
Clinically Insane
Join Date: Jun 2001
Location: planning a comeback !
Status:
Offline
|
|
Well, can't you just forward your own subdomain to the DynDNS addrress ?
-t
|
|
|
|
|
|
|
|
|
Baninated
Join Date: May 2005
Location: England
Status:
Offline
|
|
|
|
|
|
|
|
|
|
|
Mac Elite
Join Date: Mar 2002
Location: Clogland
Status:
Offline
|
|
Originally Posted by kick52
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 )
|
|
|
|
|
|
|
|
|
Clinically Insane
Join Date: Mar 2001
Location: yes
Status:
Offline
|
|
Originally Posted by kick52
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.
|
|
|
|
|
|
|
|
|
Clinically Insane
Join Date: Mar 2001
Location: yes
Status:
Offline
|
|
Originally Posted by kick52
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.
|
|
|
|
|
|
|
|
|
Baninated
Join Date: May 2005
Location: England
Status:
Offline
|
|
Originally Posted by skalie
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.
|
|
|
|
|
|
|
|
|
Mac Elite
Join Date: Mar 2002
Location: Clogland
Status:
Offline
|
|
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*
|
|
|
|
|
|
|
|
|
Baninated
Join Date: May 2005
Location: England
Status:
Offline
|
|
|
|
|
|
|
|
|
|
|
Clinically Insane
Join Date: Mar 2001
Location: yes
Status:
Offline
|
|
Originally Posted by kick52
Put a redirect in an .htaccess file located at your DocRoot (base of your website). This should work to redirect everything in a directory.
|
|
|
|
|
|
|
|
|
Baninated
Join Date: May 2005
Location: England
Status:
Offline
|
|
Originally Posted by besson3c
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?
|
|
|
|
|
|
|
|
|
Clinically Insane
Join Date: Mar 2001
Location: yes
Status:
Offline
|
|
|
|
|
|
|
|
|
|
|
Baninated
Join Date: May 2005
Location: England
Status:
Offline
|
|
Originally Posted by besson3c
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...
|
|
|
|
|
|
|
|
|
Clinically Insane
Join Date: Mar 2001
Location: yes
Status:
Offline
|
|
Originally Posted by kick52
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?
|
|
|
|
|
|
|
|
|
Baninated
Join Date: May 2005
Location: England
Status:
Offline
|
|
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!
|
|
|
|
|
|
|
|
|
Clinically Insane
Join Date: Mar 2001
Location: yes
Status:
Offline
|
|
Originally Posted by kick52
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.
|
|
|
|
|
|
|
|
|
Baninated
Join Date: May 2005
Location: England
Status:
Offline
|
|
Originally Posted by besson3c
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 /
|
|
|
|
|
|
|
|
|
Clinically Insane
Join Date: Mar 2001
Location: yes
Status:
Offline
|
|
Cool! Glad to hear that you've come up with a solution that works for you
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Forum Rules
|
|
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
|
|
|
|
|
|