Re: Parsing URL's with Apache and PHP
| From: | Raditha Dissanayake | Date: | Mon, 01 Mar 2004 16:05:39 +0000 |
| Subject: | Re: Parsing URL's with Apache and PHP | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-179168@lists.php.net to get a copy of this message | ||
Are you trying to do dynamic virtual hosting? using PHP for that would be very inefficient look at the apache documentation for a better solution.
with php splitting by the dot (.) and getting the first part ought to do the trick. or you can do a preg_match .
Brian J. Celenza wrote:
I'm trying to setup a system where I can parse the entire URL that is given in the address bar of the broswer. My intentions are to make use of the parse_url() function supplied in PHP, but I cannot find a way to get the full address requested. Example: http://bcelenza.somedomain.com/index.php?page=blah Are there variables or methods with apache I can use to get this entire address? All I'm seeing is the HTTP Referrer and some other _SERVER vars that do not give me the whole address. The reason I am trying to do this is to parse the address bcelenza.somedomain.com to return the subdomain, bcelenza. Any ideas are certainly appreciated. Thank you, Brian-- Raditha Dissanayake. ------------------------------------------------------------------------ http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader Graphical User Inteface. Just 150 KB | with progress bar.