Title: amarama's Replies | WordPress.org

---

# amarama

  [  ](https://wordpress.org/support/users/amarama/)

 *   [Profile](https://wordpress.org/support/users/amarama/)
 *   [Topics Started](https://wordpress.org/support/users/amarama/topics/)
 *   [Replies Created](https://wordpress.org/support/users/amarama/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/amarama/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/amarama/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/amarama/engagements/)
 *   [Favorites](https://wordpress.org/support/users/amarama/favorites/)

 Search replies:

## Forum Replies Created

Viewing 9 replies - 1 through 9 (of 9 total)

 *   Forum: [Networking WordPress](https://wordpress.org/support/forum/multisite/)
   
   In reply to: [Multisite bug with WP CORE ms-blogs](https://wordpress.org/support/topic/multisite-bug-with-wp-core-ms-blogs/)
 *  Thread Starter [amarama](https://wordpress.org/support/users/amarama/)
 * (@amarama)
 * [10 years, 8 months ago](https://wordpress.org/support/topic/multisite-bug-with-wp-core-ms-blogs/#post-6853870)
 * jkhongusc I tried your code it didn’t work but as I said this is resolved and
   thanks for the help again.
 *   Forum: [Networking WordPress](https://wordpress.org/support/forum/multisite/)
   
   In reply to: [Multisite bug with WP CORE ms-blogs](https://wordpress.org/support/topic/multisite-bug-with-wp-core-ms-blogs/)
 *  Thread Starter [amarama](https://wordpress.org/support/users/amarama/)
 * (@amarama)
 * [10 years, 8 months ago](https://wordpress.org/support/topic/multisite-bug-with-wp-core-ms-blogs/#post-6853866)
 * Yes I did and thanks for all of the help. However a colleague with more experience
   did help and he used the **get_blog_option** for the $blog id, then used and **
   str_replace** to replace the protocol and lastly used the **update_blog_option**
   to set it in the database so the field reads correctly when you edit the site
   setting.
 * Then the **wmpu_new_blog** hook what used when calling the function. It is always
   something simple but when you don’t know the method of how then you will dance
   all around the answer.
 * I will also try your code to I will mark this as resolved.
 *   Forum: [Networking WordPress](https://wordpress.org/support/forum/multisite/)
   
   In reply to: [Multisite bug with WP CORE ms-blogs](https://wordpress.org/support/topic/multisite-bug-with-wp-core-ms-blogs/)
 *  Thread Starter [amarama](https://wordpress.org/support/users/amarama/)
 * (@amarama)
 * [10 years, 8 months ago](https://wordpress.org/support/topic/multisite-bug-with-wp-core-ms-blogs/#post-6853845)
 * Ok I saw that the wpmu_create_blog() function hooks into the wpmu_new_blog() 
   function which is initialize upon creation of blogs. If I can interject my plugin
   code in during this add_action then I can get the results I am looking for. Yet
   I have never had to do or have done this before and need help. Everything so 
   far has been trial and error. Outside of adding it to the core.
 * I really would like to get this working.
 * Any ideas WordPress community? If I figure it out I will post my results I think
   it would be really helpful for future multisite developers and the community.
 * Thanks.
 *   Forum: [Networking WordPress](https://wordpress.org/support/forum/multisite/)
   
   In reply to: [Multisite bug with WP CORE ms-blogs](https://wordpress.org/support/topic/multisite-bug-with-wp-core-ms-blogs/)
 *  Thread Starter [amarama](https://wordpress.org/support/users/amarama/)
 * (@amarama)
 * [10 years, 8 months ago](https://wordpress.org/support/topic/multisite-bug-with-wp-core-ms-blogs/#post-6853788)
 * Also I tried adding the action as you suggested with some changes and that did
   not work in my plugin.
 * if ( !function_exists(‘get_blogaddress_by_id’) ) {
    function get_blogaddress_by_id(
   $blog_id ) { $protocol = is_ssl() ? ‘[https://&#8217](https://&#8217); : ‘[http://&#8217](http://&#8217);;
   $bloginfo = get_blog_details( (int) $blog_id, false ); // only get bare details!
   return esc_url( $protocol . $bloginfo->domain . $bloginfo->path ); } add_action(‘
   wpmu_new_blog’, ‘get_blogaddress_by_id’ ); }
 *   Forum: [Networking WordPress](https://wordpress.org/support/forum/multisite/)
   
   In reply to: [Multisite bug with WP CORE ms-blogs](https://wordpress.org/support/topic/multisite-bug-with-wp-core-ms-blogs/)
 *  Thread Starter [amarama](https://wordpress.org/support/users/amarama/)
 * (@amarama)
 * [10 years, 8 months ago](https://wordpress.org/support/topic/multisite-bug-with-wp-core-ms-blogs/#post-6853786)
 * Right now without submitting it as a bug I would like to just get it to work 
   within my plugin referencing the “_get\_blogaddress\_by\_id_” is a function that
   in in the ms-blogs.php in the includes folder what I am trying to do is find 
   the correct filter to hook into or override the core functionality of this core
   file. So the behavior works in the plugin as it does when I embed inside the 
   ms-blogs file.
 * I don’t know what I am doing wrong but it works in the core file but once it 
   has been pulled out and added it separate plugin file it then does not work.
 * Again I fixed the redirect inside of the IIS web.config file now I just need 
   to upon creating a new website get the protocol to read write and I thought you
   have to use add_filter (not add_action) to hook into core functionality.
 * I don’t know if I am missing the correct tag for the filter. This can remain 
   an issue I just need to fix it for our environment. I have not seen a fix nowhere
   and other have had the same issue. Most edited config files and core file no 
   resolutions I have seen done in plugin form.
 * Better yet, how can I get this core function embeded inside of my plugin to call(
   filter) before the site is created?
 * Thanks
 *   Forum: [Networking WordPress](https://wordpress.org/support/forum/multisite/)
   
   In reply to: [Multisite bug with WP CORE ms-blogs](https://wordpress.org/support/topic/multisite-bug-with-wp-core-ms-blogs/)
 *  Thread Starter [amarama](https://wordpress.org/support/users/amarama/)
 * (@amarama)
 * [10 years, 8 months ago](https://wordpress.org/support/topic/multisite-bug-with-wp-core-ms-blogs/#post-6853765)
 * The reason why I stated it as a bugs is because the tools should be able to detect
   if the site is either based on a condition.
 * Also I tried to edit by creating a plugin here is the code:
 * if ( !function_exists(‘get_blogaddress_by_id’) ) {
 *  function get_blogaddress_by_id( $blog_id, $scheme = null ) {
    if ( ! in_array(
   $scheme, array( ‘http’, ‘https’ ) )) $scheme = is_ssl() ? ‘https’ : ‘http’; $
   bloginfo = get_blog_details( (int) $blog_id, false ); // only get bare details!
   return esc_url( “$scheme://” . $bloginfo->domain . $bloginfo->path ); }
 * }
    add_filter(‘blogaddress_by_id’, ‘get_blogaddress_by_id’, 1);
 * I used this code to hook into the core but it is not working. I am working on
   a multi-site setup in IIS and I did find a URL rewrite fix for redirection. But
   the site upon creation is not taking this code as the code it should use to correct
   the subsite name.
 * I looked everywhere and have not found an exact answer or fix to this issue any
   suggestions to fix my code.
 * Thanks
 *   Forum: [Networking WordPress](https://wordpress.org/support/forum/multisite/)
   
   In reply to: [Multisite bug with WP CORE ms-blogs](https://wordpress.org/support/topic/multisite-bug-with-wp-core-ms-blogs/)
 *  Thread Starter [amarama](https://wordpress.org/support/users/amarama/)
 * (@amarama)
 * [10 years, 8 months ago](https://wordpress.org/support/topic/multisite-bug-with-wp-core-ms-blogs/#post-6853680)
 * Also I wanted to know if I could modify this fix via github [HERE](https://github.com/WordPress/WordPress/blob/master/wp-includes/ms-blogs.php)
   so it is included in future releases.
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Permalinks stopped working](https://wordpress.org/support/topic/permalinks-stopped-working-4/)
 *  [amarama](https://wordpress.org/support/users/amarama/)
 * (@amarama)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/permalinks-stopped-working-4/#post-4448723)
 * The problem was how our server access the .htaccess file and how the mod_rewrite
   works for our golbal settings for all of our sites.
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Permalinks stopped working](https://wordpress.org/support/topic/permalinks-stopped-working-4/)
 *  [amarama](https://wordpress.org/support/users/amarama/)
 * (@amarama)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/permalinks-stopped-working-4/#post-4448722)
 * I am having the same issue the server I’m using does have the mod_rewrite installed
   but because of the security issues of the .htaccess file this file in no longer
   accessible at the wordpress install level.
 * I need to know what rules should I used on my server’s global .htaccess file 
   that will make the permalinks works. Please note all of the Apache Allow rules
   and other rewrite may not be used based on the security risk they impose.
 * I will check the error logs again and update this post if I see anything helpful.
 * Thanks.

Viewing 9 replies - 1 through 9 (of 9 total)