WordPress.org

Ready to get started?Download WordPress

Forums

Uploads not working when forcing https ( redirect ) (2 posts)

  1. xinti
    Member
    Posted 6 years ago #

    Hello,

    When i force the /wp-admin/ to be https with a redirect in apache22 conf the uploads function is not working anymore and some of the functions like deleting a page/post from the admin only work when i choose edit from viewing the page/post logged in as admin.

    Is there no https support? It seems to me a bit weird we get forced to use our usernames/passwords in an unsafe manner..

    Tnx in advance!

  2. kap4002
    Member
    Posted 6 years ago #

    I ran into the same problem and fixed it (somewhat dirty) by editing wp-admin/includes/media.php, i changed the line 841 from

    $form_action_url = get_option('siteurl') . "/wp-admin/media-upload.php?type=$type&tab=type&post_id=$post_id";

    to

    $form_action_url = "/wp-admin/media-upload.php?type=$type&tab=type&post_id=$post_id";

    this changes the upload form action-url from an absolute to a relative one, the (stupid) absolute url had http://.. (without s) hardcoded. this then leads to an uploading error when submitting the form, because apache rewrites the request and sends a code 302, which generates another request to the correct url (with s) but, strange, without POST data.

    see my fix as "worksforme", there might be a better solution. for example to exclude /wp-admin/media-upload.php from being rewritten by apache (but then the uploads will not be transmitted securely).

    edit: this is for wordpress 2.5.1

Topic Closed

This topic has been closed to new replies.

About this Topic