PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Programmation & Conception > php.general > $ SERVER["REQUEST URI"] includes domain unexpectedly
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
$ SERVER["REQUEST URI"] includes domain unexpectedly

Réponse
 
LinkBack Outils de la discussion
Vieux 15/09/2007, 05h21   #1
junk@realtechtalk.com
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut $ SERVER["REQUEST URI"] includes domain unexpectedly


In my old server running Apache 1.3 and PHP 4 this code will return just the URI as expected:





$_SERVER["REQUEST_URI"] = "/some-html-file.html"





In my new server with Apache 2 & PHP 4 this code returns the domain:


$_SERVER["REQUEST_URI"] = "/full-domain-name.com/some-html-file.html"





Does anyone know a way to change things so the code will not return the
domain name and whether this is because of PHP or Apache that I'm
suddenly getting the full domain name?
  Réponse avec citation
Vieux 15/09/2007, 07h09   #2
Jim Lucas
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: [PHP] $ SERVER["REQUEST URI"] includes domain unexpectedly

junk@realtechtalk.com wrote:
>
> In my old server running Apache 1.3 and PHP 4 this code will return just
> the URI as expected:
>
>
>
>
>
> $_SERVER["REQUEST_URI"] = "/some-html-file.html"
>
>
>
>
>
> In my new server with Apache 2 & PHP 4 this code returns the domain:
>
>
> $_SERVER["REQUEST_URI"] = "/full-domain-name.com/some-html-file.html"
>
>
>
>
>
> Does anyone know a way to change things so the code will not return the
> domain name and whether this is because of PHP or Apache that I'm
> suddenly getting the full domain name?
>

Windows, linux, Sun, etc...

Which version of PHP and Apache (old and new) exactly?

Sounds to me like the new system is running with a DNS redirect.

A friend of mine a month ago or so, had a similar setup.

He was using a DNS redirect to hit the correct page on a IIS server.

Poor mans way of doing virtual hosting.

Am I anywhere close?

--
Jim Lucas


"Perseverance is not a long race;
it is many short races one after the other"

Walter Elliot



"Some men are born to greatness, some achieve greatness,
and some have greatness thrust upon them."

Twelfth Night, Act II, Scene V
by William Shakespeare
  Réponse avec citation
Vieux 15/09/2007, 16h19   #3
Greg Donald
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: [PHP] $ SERVER["REQUEST URI"] includes domain unexpectedly

On Fri, 14 Sep 2007, junk@realtechtalk.com wrote:
> In my old server running Apache 1.3 and PHP 4 this code will return just the
> URI as expected:
>
> $_SERVER["REQUEST_URI"] = "/some-html-file.html"
>
> In my new server with Apache 2 & PHP 4 this code returns the domain:
>
> $_SERVER["REQUEST_URI"] = "/full-domain-name.com/some-html-file.html"


basename() will assist you in getting the last part of the
$_SERVER['REQUEST_URI'] path.. seems like that's what you're after.

http://php.net/basename


--
Greg Donald
Cyberfusion Consulting
http://cyberfusionconsulting.com/
  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 23h18.


É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,07861 seconds with 11 queries