Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I have a strange behaviour on my backend. This is possible due to the way my WordPress is located.

I installed it in a VirtualBox, using Ubuntu from the standard repository (i.e., apt-get install wordpress). It is located in /var/www/ as per default. The virtual mashine is mapped to a subfolder of my institution's web page. Let's call it www.institution.com/stuff/wordpress.

Most works fine, I can log in to the backend, create pages, etc. But, if I make changes in Settings/General and click on the "Save changes" button I get an "Error: NotFound". The changes are saved, but WordPress tries to send me to

www.institution.com/wp-admin/options-general.php?settings-updated=true

but this has to be

www.institution.com/stuff/wordpress/wp-admin/options-general.php?settings-updated=true

(/stuff/wordpress is missing)

Both, the "WordPress Address URL" and "Site URL" are set to "www.institution.com/stuff/wordpress". But obviously, this is not enough.

Has anybody an idea what wrong with my WordPress?

share|improve this question
add comment

1 Answer

I solved it with the help of a colleagues of mine by adding the following lines into wp-config.php:

$_SERVER['HTTP_HOST'] = $_SERVER['HTTP_X_FORWARDED_HOST'];
$_SERVER['REQUEST_URI'] = '/stuff/wordpress' . $_SERVER['REQUEST_URI'];
$_SERVER['SCRIPT_NAME'] = '/stuff/wordpress' . $_SERVER['SCRIPT_NAME'];
$_SERVER['PHP_SELF'] = '/stuff/wordpress' . $_SERVER['PHP_SELF'];
$_SERVER['REMOTE_ADDR'] = $_SERVER['HTTP_X_FORWARDED_FOR'];
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.