Re: [PHP] some kind of redirection (not the header function)
From: "Juan Nin" <[EMAIL PROTECTED]> > The beheaviour I want to acomplish is the same as in yahoorgoups. > > You can access a mian page, where you login and have a list of all the groups you are subscribe to. > You click on the link to each one and it redirects you to: http://groups.yahoo.com/groups/yourGroup/ > > There it displays the page for your group with all it´s characteristics. The same behaviour > if you access that URL directly. Or you can also access http://groups.yahoo.com/groups/yourGroup/messages/ etc > > Thatś what I ant to do :) > > Any ideas? This is doable. It's discussed on here often. Basically, you use an apache command to FORCE "groups" to be a PHP file. Then the remainder of the URL is available in $_SERVER['REQUEST_URI']. You parse that to determine what group the user is after, retrieve the content, and show it. Search the archives or google for "search friendly urls" and you should get some good tutorials or instructions. ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] some kind of redirection (not the header function)
On Thu, 2003-09-11 at 16:20, Peter James wrote: > mod_rewrite allows you to do internal redirects. This would keep your > user's URL the same, but actually point to a different page internally. > This is, of course, depends on whether you or your host have mod_rewrite > installed. cool, it was the first thing I had thought off, but after giving a quick look at it I thought it rewrited the URLs... I´ll take a better look at it!!! Thanks!!! I guess there´s no way to do something like this only with PHP, without Apache conf, is there? thnx again, Juan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] some kind of redirection (not the header function)
On Thu, 2003-09-11 at 16:04, Ed Curtis wrote: > I'm pretty sure that YahooGroups uses cookies for this to hold values > while you're not on their site. When you return it checks for the cookies > and reloads the values from the last visit. You can accomplish this with > PHP as well. that´s clear, I know that, but thatś not what I want... I mean, the thing is that I want to execute the same PHP scripts, no matter what directory I´m in, but show data according to what directory I´m in, exactly the same that happens with yahoogroups and it´s groups that´s why I´m thinking in putting the PHP pages in each directory which just include the common PHPs from an include directory (could use hard links either, but I prefer doing it via PHP and not depend on Os stuff) so that´s what I´m asking, if there´s a better way to achieve this, not talking about cookies :) Juan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] some kind of redirection (not the header function)
> I thought that maybe with some Apache stuff, but I don´t think thereś > something that will help, since directives such as RedirectMatch, etc. > rewrite the URL, and I don´t want that, I want the URL to remain > http://www.domain.com/directoryX/whatever.php mod_rewrite allows you to do internal redirects. This would keep your user's URL the same, but actually point to a different page internally. This is, of course, depends on whether you or your host have mod_rewrite installed. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] some kind of redirection (not the header function)
I'm pretty sure that YahooGroups uses cookies for this to hold values while you're not on their site. When you return it checks for the cookies and reloads the values from the last visit. You can accomplish this with PHP as well. Ed On Thu, 11 Sep 2003, Juan Nin wrote: > On Thu, 2003-09-11 at 15:39, Ed Curtis wrote: > > Is there any type of criteria that would point a user to directoryA or > > directoryB? > > > > I recently rebuilt a site that handled a couple thousand > > different working directories for clients but used only one set of > > scripts for all. The user would have to login and variables were pulled > > from a database to set the directory that they would work in. The > > directory name could be passed from script to script or stored in > > sessions. > > The beheaviour I want to acomplish is the same as in yahoorgoups. > > You can access a mian page, where you login and have a list of all the groups you > are subscribe to. > You click on the link to each one and it redirects you to: > http://groups.yahoo.com/groups/yourGroup/ > > There it displays the page for your group with all it´s characteristics. The same > behaviour > if you access that URL directly. Or you can also access > http://groups.yahoo.com/groups/yourGroup/messages/ etc > > That¶ what I ant to do :) > > Any ideas? > > thnx again, > > Juan > > -- > 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] some kind of redirection (not the header function)
On Thu, 2003-09-11 at 15:39, Ed Curtis wrote: > Is there any type of criteria that would point a user to directoryA or > directoryB? > > I recently rebuilt a site that handled a couple thousand > different working directories for clients but used only one set of > scripts for all. The user would have to login and variables were pulled > from a database to set the directory that they would work in. The > directory name could be passed from script to script or stored in > sessions. The beheaviour I want to acomplish is the same as in yahoorgoups. You can access a mian page, where you login and have a list of all the groups you are subscribe to. You click on the link to each one and it redirects you to: http://groups.yahoo.com/groups/yourGroup/ There it displays the page for your group with all it´s characteristics. The same behaviour if you access that URL directly. Or you can also access http://groups.yahoo.com/groups/yourGroup/messages/ etc Thatś what I ant to do :) Any ideas? thnx again, Juan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] some kind of redirection (not the header function)
Is there any type of criteria that would point a user to directoryA or directoryB? I recently rebuilt a site that handled a couple thousand different working directories for clients but used only one set of scripts for all. The user would have to login and variables were pulled from a database to set the directory that they would work in. The directory name could be passed from script to script or stored in sessions. Ed On Thu, 11 Sep 2003, Juan Nin wrote: > Hi!!! > > I´m programming a site in PHP, where I want to do the following: > > I will have a set of different directories, where each directory must > execute the same PHP pages, but giving as result different data, > according to the directory where you are located (obtained by > $_SERVER[´PHP_SELF´] for example). > > For example I have: > > http://www.domain.com/directoryA/ > http://www.doamin.com/directoryB/ > > So each one must have (or should act as if they had) the same PHP pages > and directories under them. > > The solution I thought, as copying each page in every directory makes no > sense (if I modify the code I´ll have to change all the pages in all > directories), is to have an includes directory. where I put all the PHP > pages, and in each of the different directories I create pages that > simply include or require the ones from the include directories. > > That way I´ll only modify code inone place.. > > Now.. is there any better way to achieve this?? > I thought that maybe with some Apache stuff, but I don´t think there¶ > something that will help, since directives such as RedirectMatch, etc. > rewrite the URL, and I don´t want that, I want the URL to remain > http://www.domain.com/directoryX/whatever.php > > Is there any way to do this, or I should stick up with the includes?? > > Thnx in advance, > > Juan > > -- > 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