UK Webmaster Talk - Online Marketing - SEO


 

Gather URL From Address Bar?

This is a discussion on Gather URL From Address Bar? within the Php and MySQL forums, part of the Programming / Scripting / Coding category; Im not sure if this is in right scripting section but here goes nothing; I have got a problem, i ...


Go Back   UK Webmaster Talk - Online Marketing - SEO > Website Design & Development > Programming / Scripting / Coding > Php and MySQL

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Notices

Reply

 

LinkBack Thread Tools Display Modes
Old 17-04-2005, 22:10   #1 (permalink)
Senior Member
 
Join Date: Apr 2005
Posts: 1,088
iTrader: 0 / 0%
Departed is a name known to allDeparted is a name known to all
Default Gather URL From Address Bar?

Im not sure if this is in right scripting section but here goes nothing;


I have got a problem, i have 3 parked domains at my hosting account, i need them to "point" to different sub-directories within my hosting account.
After speaking to my hosting support they say it is not possible, (Tell me if they're wrong) so i need another alternative.

I was thinking of a script like this. This script would gather the URL from the address bar and then redirect to a page determinde by me.

So say i went to www.flubb.com the script would gather the url and redirect to www.flubb.com/flubb.
And if i went to www.jdjokes.com the script would gather the url and redirect to www.jdjokes.com/jdjokes.


Hope it makes sense.

Flubber

EDIT: If worse comes to worse i can just have a spash page saying "What are you looking for" and then they click what the site they are looking for. But i would rather a script.
__________________
-Gary
Departed is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 17-04-2005, 22:30   #2 (permalink)
Moderator
 
Join Date: Mar 2005
Location: Barnsley, UK
Posts: 1,001
iTrader: 0 / 0%
Wistow has a reputation beyond reputeWistow has a reputation beyond reputeWistow has a reputation beyond reputeWistow has a reputation beyond reputeWistow has a reputation beyond reputeWistow has a reputation beyond repute
Default

Can you not just use $_SERVER['REQUEST_URI'] ?
Not sure if this would do what you are wanting, but it will return the name of the requested url

Craig
Wistow is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 17-04-2005, 22:32   #3 (permalink)
Senior Member
 
Join Date: Apr 2005
Posts: 1,088
iTrader: 0 / 0%
Departed is a name known to allDeparted is a name known to all
Default

Yeah, but then how would i use that to redirect; when the url is a certain domain; to a certain page?
__________________
-Gary
Departed is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 17-04-2005, 22:35   #4 (permalink)
Moderator
 
Join Date: Mar 2005
Location: Barnsley, UK
Posts: 1,001
iTrader: 0 / 0%
Wistow has a reputation beyond reputeWistow has a reputation beyond reputeWistow has a reputation beyond reputeWistow has a reputation beyond reputeWistow has a reputation beyond reputeWistow has a reputation beyond repute
Default

using IF statements?

Craig
Wistow is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 17-04-2005, 22:35   #5 (permalink)
WMT Addict
 
Join Date: Apr 2005
Location: Pennsylvania
Posts: 147
iTrader: 0 / 0%
Ic3CoLd will become famous soon enough
Default

how about:

<?php

if ($_SERVER['REQUEST_URL'] == "http://domain.com") {

header('Location: http://place.com/wherverv');

} else if ($_SERVER['REQUEST_URL'] == "http://domain1.com") {

header('Location: http://place.com/wherverv');

}
?>
And do that. I'm not great at PHP, just started, but it's a guess ;P
__________________
Better than Firefox? Try Maxthon
Ic3CoLd is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 17-04-2005, 22:37   #6 (permalink)
Senior Member
 
Join Date: Apr 2005
Posts: 1,088
iTrader: 0 / 0%
Departed is a name known to allDeparted is a name known to all
Wink

If you could give me the exact code where i only have to change the domains and specifics, it would make life a gawd lot easier for the fat guy.
And theres some WMT? in it for you, even though you're the admin.... :s
Im off to sleep check back tommorow after school.

Thanks in advance

Flubber.

EDIT: Trying Ic3colds solution. But if you find a flaw in it before i do please tell. Thanks ic3cold!
__________________
-Gary
Departed is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 17-04-2005, 22:42   #7 (permalink)
Moderator
 
Join Date: Mar 2005
Location: Barnsley, UK
Posts: 1,001
iTrader: 0 / 0%
Wistow has a reputation beyond reputeWistow has a reputation beyond reputeWistow has a reputation beyond reputeWistow has a reputation beyond reputeWistow has a reputation beyond reputeWistow has a reputation beyond repute
Default

Ic3cold's solution should work, if you replace the REQUEST_URL with REQUEST_URI

Craig
Wistow is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 17-04-2005, 22:58   #8 (permalink)
WMT Addict
 
Join Date: Apr 2005
Location: Pennsylvania
Posts: 147
iTrader: 0 / 0%
Ic3CoLd will become famous soon enough
Default

oops, sorry, I thought you made a type and it was URL. Sorry, here it is all agian:

PHP Code:
<?php

if ($_SERVER['REQUEST_URI'] == "http://domain.com") {

header('Location: http://place.com/wherverv');

} else if (
$_SERVER['REQUEST_URI'] == "http://domain1.com") {

header('Location: http://place.com/wherverv');

}
?>
What does URI mean anyways?
__________________
Better than Firefox? Try Maxthon
Ic3CoLd is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 17-04-2005, 23:01   #9 (permalink)
Moderator
 
Join Date: Mar 2005
Location: Barnsley, UK
Posts: 1,001
iTrader: 0 / 0%
Wistow has a reputation beyond reputeWistow has a reputation beyond reputeWistow has a reputation beyond reputeWistow has a reputation beyond reputeWistow has a reputation beyond reputeWistow has a reputation beyond repute
Default

URI means Uniform Resource Identifier and is exactly the same as what a URL is (Uniform Resource Locator) Just different acronyms I suppose

Craig
Wistow is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 17-04-2005, 23:06   #10 (permalink)
WMT Addict
 
Join Date: Apr 2005
Location: Pennsylvania
Posts: 147
iTrader: 0 / 0%
Ic3CoLd will become famous soon enough
Default

Well, I learned something new today Hope that works for you Flubber
__________________
Better than Firefox? Try Maxthon
Ic3CoLd is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Tags
address, bar, gather, url

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

Similar Threads

Thread Thread Starter Forum Replies Last Post
icon in address bar benf Programming / Scripting / Coding 2 07-06-2005 11:43
Free funny e-mail address! Bmg General Webmaster Discussion 9 14-05-2005 19:49
Logo in the Browsers Address Bar - Favicon.ico Wistow Website Design Articles 0 19-03-2005 15:49


All times are GMT +1. The time now is 02:24.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0
UK Webmaster Forum © WebmasterTalk.co.uk | Design by Forbairt

Ad Management by RedTyger

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41