Title: [Plugin: Relocate Upload] not work with HTTPS
Last modified: August 19, 2016

---

# [Plugin: Relocate Upload] not work with HTTPS

 *  [shakemid](https://wordpress.org/support/users/shakemid/)
 * (@shakemid)
 * [15 years, 8 months ago](https://wordpress.org/support/topic/plugin-relocate-upload-not-work-with-https/)
 * Hello,
 * I found it does not work with HTTPS.
    I made a patch for relocate-upload.php 
   to work with HTTPS. It seems to work well with WordPress 3.0.1.
 * Please consider about the patch.
    Regards.
 *     ```
       --- relocate-upload.php.orig    2010-10-11 20:06:04.000000000 +0900
       +++ relocate-upload.php 2010-10-11 20:30:11.000000000 +0900
       @@ -92,7 +92,11 @@
               {       jQuery($element).attr({disabled: true});
                       jQuery($element).siblings("span").html(' Moving...');
                       jQuery.get(
       -                       "<?php echo WP_CONTENT_URL."/plugins/relocate-upload/relocate-upload.php"; ?>",
       +                       "<?php
       +                $content_url = ( empty($_SERVER['HTTPS']) )
       +                    ? WP_CONTENT_URL
       +                    : str_replace( "http://", "https://", WP_CONTENT_URL );
       +                echo $content_url."/plugins/relocate-upload/relocate-upload.php"; ?>",
                               {       ru_folder: $element.selectedIndex,
                                              id: $element.getAttribute('media_id'),
                                        _wpnonce: '<?php echo wp_create_nonce("ru_request_move") ?>',
       @@ -292,6 +296,6 @@
   
        add_filter( 'wp_get_attachment_url', "wp_get_attachment_url_absolute_path_fix");
       -function wp_get_attachment_url_absolute_path_fix($url) {       return preg_replace('#(http://.*?/).*?/'.(SERVER_DOC_ROOT).'/#','\1',$url); }
       +function wp_get_attachment_url_absolute_path_fix($url) {       return preg_replace('#(https?://.*?/).*?/'.(SERVER_DOC_ROOT).'/#','\1',$url); }
   
        ?>
       ```
   

The topic ‘[Plugin: Relocate Upload] not work with HTTPS’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/relocate-upload.svg)
 * [Relocate Upload](https://wordpress.org/plugins/relocate-upload/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/relocate-upload/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/relocate-upload/)
 * [Active Topics](https://wordpress.org/support/plugin/relocate-upload/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/relocate-upload/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/relocate-upload/reviews/)

 * 0 replies
 * 1 participant
 * Last reply from: [shakemid](https://wordpress.org/support/users/shakemid/)
 * Last activity: [15 years, 8 months ago](https://wordpress.org/support/topic/plugin-relocate-upload-not-work-with-https/)
 * Status: not resolved