[PHP] Re: redirector
First things first, when you say domain.com/home/adam do you mean /home/httpd/htdocs/home/adam or /home/adam/public_html.. Once you know that you can make a more educated decision.. Either way, you should be able to specifiy DocumentRoot /home/adam/public_html or DocumentRoot /home/httpd/htdocs/home/adam in your httpd.conf file for VirtualHost adam.domain.com:80. Unless you are talking about authenticating users or something and redirecting specific users to the target and the rest somewhere else.. Bob Joerg Hanke [EMAIL PROTECTED] wrote in message 002701c1dd9a$69c08010$0400a8c0@Joerg">news:002701c1dd9a$69c08010$0400a8c0@Joerg... hi, i've got the possibility to create alias subdomains, which redirect all to the document-root... e.g.: http://adam.domain.com redirects to http://domain.com i want to redirect the users who access http://adam.domain.com to http://domain.com/home/adam how to do this best in php?? reguards, george -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: redirector
Well, then you probably can't do much with Apaches mod_rewrite then either.. I know of a Javascript command for doing that history.replace() but if you're looking for something in PHP, I'm pretty new to PHP and don't know of anything offhand.. My programmer integrates some Javascript into our stuff I think (maybe window.location()).. And then sends a location= value to it.. Here's what I could find in the stuff he does for us: function javascriptJump( $location ) { global $PHPSESSID, $HTTP_USER_AGENT; if( ( $PHPSESSID or ini_get( session.use_cookies ) == 0 ) and ereg( \?, $location ) ) $location .= PHPSESSID=$PHPSESSID; if( !headers_sent() ) header( Location: $location ); else { print html\n; print head\n; print script language=javascript\n; print location='$location';\n; print /script\n; print /head\n; print body bgcolor=white\n; print Jumping to a href=\$location\$location/a via javascript. If you don't have javascript enabled, click on the link.\n; print /body\n; print /html; } exit; } This is one parts he calls that javascriptJump() function from: javascriptJump( $PHP_SELF?command=updateInventoryupdate=done ); Hope this might help out some.. Later, Bob Weaver - Original Message - From: Joerg Hanke [ML-php] [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Saturday, April 06, 2002 4:20 PM Subject: AW: [PHP] Re: redirector i do not own a server, i just own a virtual host, an ordinary webspace... i can't do anything in httpd.conf -Ursprüngliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Gesendet: Samstag, 06. April 2002 21:30 An: [EMAIL PROTECTED] Betreff: [PHP] Re: redirector First things first, when you say domain.com/home/adam do you mean /home/httpd/htdocs/home/adam or /home/adam/public_html.. Once you know that you can make a more educated decision.. Either way, you should be able to specifiy DocumentRoot /home/adam/public_html or DocumentRoot /home/httpd/htdocs/home/adam in your httpd.conf file for VirtualHost adam.domain.com:80. Unless you are talking about authenticating users or something and redirecting specific users to the target and the rest somewhere else.. Bob Joerg Hanke [EMAIL PROTECTED] wrote in message 002701c1dd9a$69c08010$0400a8c0@Joerg">news:002701c1dd9a$69c08010$0400a8c0@Joerg... hi, i've got the possibility to create alias subdomains, which redirect all to the document-root... e.g.: http://adam.domain.com redirects to http://domain.com i want to redirect the users who access http://adam.domain.com to http://domain.com/home/adam how to do this best in php?? reguards, george -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: redirector
Oh hey, I found this.. It looks like it might be something along the lines of what you need.. http://www.php.net/manual/en/function.header.php#AEN23288 Now that I look back through the stuff my programmer did that I send earlier, he uses the header() function.. I just has to be send first and he tests for that then uses Javascript to redirect if they have it seems.. Anyway, hope this is useful to you.. Later, Bob Weaver - Original Message - From: Joerg Hanke [ML-php] [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Saturday, April 06, 2002 4:20 PM Subject: AW: [PHP] Re: redirector i do not own a server, i just own a virtual host, an ordinary webspace... i can't do anything in httpd.conf -Ursprüngliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Gesendet: Samstag, 06. April 2002 21:30 An: [EMAIL PROTECTED] Betreff: [PHP] Re: redirector First things first, when you say domain.com/home/adam do you mean /home/httpd/htdocs/home/adam or /home/adam/public_html.. Once you know that you can make a more educated decision.. Either way, you should be able to specifiy DocumentRoot /home/adam/public_html or DocumentRoot /home/httpd/htdocs/home/adam in your httpd.conf file for VirtualHost adam.domain.com:80. Unless you are talking about authenticating users or something and redirecting specific users to the target and the rest somewhere else.. Bob Joerg Hanke [EMAIL PROTECTED] wrote in message 002701c1dd9a$69c08010$0400a8c0@Joerg">news:002701c1dd9a$69c08010$0400a8c0@Joerg... hi, i've got the possibility to create alias subdomains, which redirect all to the document-root... e.g.: http://adam.domain.com redirects to http://domain.com i want to redirect the users who access http://adam.domain.com to http://domain.com/home/adam how to do this best in php?? reguards, george -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php