Moving to a modified URL
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.php archive

Moving to a modified URL

From: Normand Peladeau <peladeau@see_our_domain.com>
Date: Wed Jun 29 2005 - 19:54:41 CEST

I would like to create a link on a web page that will call a script and jump
to an URL similar but slightly different than the current one. I am doing
this to allow people to switch languages. For example, no matter where the
user is on my web site, if he clicks on the FRENCH button at the top, he
will be moved from:

    http://www.mydomain.com/apage.html

to

    http://www.mydomain.com/fr/apage.html

On this French version of the web page, if he clicks on the ENGLISH button,
he will be moved back to the:

    http://www.mydomain.com/apage.html

Since we have more than 60 pages, we don't want to create 120 links on each
page. We would prefer to have two scripts, one that will insert a /fr after
the domain name (to move to the French site), and another one that will
remove this /fr in order to move to the English version of this page.

Is this something that can be done with PHP?

Normand P.
Received on Mon Oct 17 20:59:21 2005