PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Programmation & Conception > comp.lang.php > header()
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
header()

Réponse
 
LinkBack Outils de la discussion
Vieux 26/03/2008, 15h28   #1
rallykarro@hotmail.com
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut header()

Hi,

I have a question regarding the header() function call in PHP.
I have a simple redirect directive as below in a file http://www.xxxx.com/en/test.php:

<?
header("Location: /en/index.php");exit;
?>

This basically redirects the user to the english index.php page. The
functionality is working just fine, but the url looks strange.

I get after the redirect a url looking like http://www.xxxx.com/en/test.php
even though it is http://www.xxxx.com/en/index.php that is displayed
in the browser. Why is it like that? i want the url to look like
http://www.xxxx.com/en/index.php after its been redirected. Basically
it displayes the correct content with the wrong url.

thanks,

Karolina

  Réponse avec citation
Vieux 26/03/2008, 16h37   #2
Jerry Stuckle
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: header()

rallykarro@hotmail.com wrote:
> Hi,
>
> I have a question regarding the header() function call in PHP.
> I have a simple redirect directive as below in a file http://www.xxxx.com/en/test.php:
>
> <?
> header("Location: /en/index.php");exit;
> ?>
>
> This basically redirects the user to the english index.php page. The
> functionality is working just fine, but the url looks strange.
>
> I get after the redirect a url looking like http://www.xxxx.com/en/test.php
> even though it is http://www.xxxx.com/en/index.php that is displayed
> in the browser. Why is it like that? i want the url to look like
> http://www.xxxx.com/en/index.php after its been redirected. Basically
> it displayes the correct content with the wrong url.
>
> thanks,
>
> Karolina
>
>


First of all, you should use the full URI, i.e.

header("Location: http://www.example.com/en/index.php");exit;

(use example.com - unless you own xxxx.com. That's what example.com,
..org, etc. are reserved for).

And it sounds like maybe you have a redirect on your system - maybe in
your .htaccess file?

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 07h57.


Édité par : vBulletin® version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,07149 seconds with 10 queries