Unwanted redirect in admin area

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.

Read More

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?

Related posts

Leave a Reply

1 comment

  1. 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'];