I would like to redirect authors when they visit the URL mynetwork.com/OWNBLOG/wp-admin/upload.php
to another page. How can I do that?
I tried this code but i received this error :
"Warning: Cannot modify header information - headers already sent by (output started at /home/content/59/104129/html/wp-admin/includes/template.php:1642) in /home/content/59/10412659/html/wp-includes/pluggable.php on line 876" :
add_action( 'admin_head-upload.php', 'redirect_media_library_wpse_93626' );
function redirect_media_library_wpse_93626()
{
// Stop if not Multisite
if( !is_multisite() )
return;
// Stop if is main site
if( is_main_blog() )
return;
// Stop if is administrator
if( current_user_can( 'add_users' ) )
return;
// Finally, redirect
// wp_redirect( site_url( 'personal-page' ) ); // http://subsite.example.com/personal-page
// wp_redirect( 'http://example.com' );
wp_redirect( admin_url() ); // http://subsite.example.com/wp-admin
exit();
}