[wp-trac] [WordPress Trac] #17669: URL is incorrect when trying to post media/image/audio/video

WordPress Trac wp-trac at lists.automattic.com
Sat Aug 18 20:00:57 UTC 2012


#17669: URL is incorrect when trying to post media/image/audio/video
--------------------------+------------------------------
 Reporter:  AllyUnion     |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  HTTP          |     Version:  3.1.3
 Severity:  normal        |  Resolution:
 Keywords:                |
--------------------------+------------------------------
Changes (by merty):

 * component:  Post Types => HTTP


Comment:

 Even though I actually agree with @nacin, I also think that we need to
 consider situations where it may not be possible to make necessary changes
 in the server configuration. I recently came across the same problem on a
 client's project where I had a limited time to fix and had no access to
 the server that needs a modification in its configuration. Since
 prepending the site URL would do no harm to WordPress and actually solve
 people's problems, I think it should be implemented.

 I had to solve this problem quickly, so I put the following to the mu-
 plugins directory:

 {{{
 function merty_fix_redirect_location( $location ) {

         if ( '/' == $location[0] )
                 $location = site_url() . $location;

         return $location;
 }

 add_filter( 'wp_redirect', 'merty_fix_redirect_location' );
 }}}

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/17669#comment:8>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list