Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

REQUEST_URI unexpectedly contains FQDN

Tags:

php

apache

ubuntu

On my main web server, the $_SERVER variable REQUEST_URI always contains something like "/filename.php" however on my development server (PHP Version 5.3.5-1ubuntu7.3, Apache 2.2.17) the same variable contains "http://www.example.com/filename.php" (e.g. includes the fully qualified domain name not just the path).

This is causing problems for several CMS packages I work with (e.g. Wordpress and Joomla) which seem to rely on the contents of REQUEST_URI.

Does anyone have any suggestions on what I need to change on the development server to make REQUEST_URI behave as expected?

like image 732
TalkingQuickly Avatar asked Nov 07 '11 17:11

TalkingQuickly


1 Answers

Using proxy & HTTP 1.1 leads to full URL in REQUEST_URI variable in Apache. Web applications have to test REQUEST_URI before trying to concatinate it with host (this bug exists in Wordpress CMS for example).

like image 98
Denis Shvydenko Avatar answered Oct 19 '22 04:10

Denis Shvydenko