Re: (URL Translating) Apache, PHP, and the love of it all.... well, maybe not.

From: Date: Sat, 03 Mar 2001 22:27:07 +0000
Subject: Re: (URL Translating) Apache, PHP, and the love of it all.... well, maybe not.
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-42475@lists.php.net to get a copy of this message
> I'm going to start with a nice simple, hopefully, questions. > > Some of you may have seen PCWorld.com - and its urls that are like > http://www.pcworld.com/news/view/0,aid,3911,00.asp. This is > achieved with a > product called XCache (for IIS, visit www.xcache.com), wich translates this > url into http://www.pcworld.com/news/view.asp?aid=3911. > > Now, you can probably do this in regex, and use the mod_rewrite, but this is > not available to me, so we can all forget that one right away ;-). > > I have created a 404-processor that does the conversion (and even checks if > the resultant page exsists, by using a simple file_exists();). > > Apache (or was it PHP? Or a combination of the above?) used to, when you > said Header ("Location: /localpath"), just serve up the content, without > doing a redirect. Under Apache/1.3.17 & PHP/4.0.4 this does not happen. How about include()? Instead of redirect. FYI. Location: header must be absolute URI. (Content-Location: can be relative URI) Most browsers accept relative URI, though. > Is there a way to do this redirect internally - ie. the browser is not even > aware that the URL is different from the one it requested, let alone the > visitor. > > And no, frames are not really an option: because it would defeat one of the > reasons I want to do this internally, which is to prevent the need to do > two requests. If you want to prevent multiple requests to server, you should not use Location: header. > > Hopefully someone will understand this (I'm sure there will be many), and be > able to guide towards something that will work. Hope I understand your mail. Regards, Yasuo Ohgaki > Thanks, > Patrick. > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net > >

« previous php.general (#42475) next »