The obvious problem is that you are trusting user input (http headers) which makes your code suspicious from security POV.
Other then that, no real problems with it, but my experience is that such hacks have a tendency to just move whatever problem you are trying to solve this way to another place.
Related Posts:
- Does WordPress MultiSite use separate MySql databases?
- Multisite Network menu links not updating
- ERR_TOO_MANY_REDIRECTS when i config my subdomains
- Problem with new Multisite Installation
- Domain not redirected correctly with WordPress Multisite
- Update siteurl and home in multisite subsites to https
- Multisite subdirectory blogs missing slash
- Site Redirecting to wp-signup.php
- Moving a WP Multisite to a subdirectory
- How to add Custom Blog Options to new blog setup form?
- Switching MultiSite installation from HTTP to HTTPS
- Add additional Network constants to wp-config.php dynamically
- Multisite Network Port Num Issues?
- Why is WordPress Multisite redirecting to wp-signup.php and how to fix it?
- Plugin for editing options on multisite?
- How do I change the Multisite URL?
- multisite 404 error for subdirectory
- WordPress Multisite with multiple domains using Nginx
- differences between behavior get_option vs get_site_option in multisite
- WP-Admin not working properly at WordPress multisite with subdirectories
- How to individually set WP_DEBUG on a sub-directory multisite?
- COOKIE_DOMAIN setting confusion
- How To Provide Sub-Blogs Their Own Domain Names?
- domain mapping confused about sunrise
- Multisite: How to store global options vs. site options?
- Ban SiteNames Multisite
- Multisite behind Varnish
- How do I share plugin settings across WordPress network?
- Blog Settings import/export in WordPress Network environment
- Generate WP-CLI @alias for each site on multisite
- WordPress multisite subdirectory redirect infinite loop issue
- What is the correct form action URL for network options pages?
- Multisite with path, how to change the main site
- Suppress subdirectory from WordPress Multisite primary URL
- Broken image multisite
- (How) Can I change my Multisite Network to use a different blog as Primary?
- Hide root site in Multisite install
- How to update_site_option for specific site within network?
- how do I configure nginx for wordpress multisite, it occurs ERR_TOO_MANY_REDIRECTS
- WordPress (+WPMU) Import/Export ALL settings?
- Alias domain to Multi-site installation in Apache
- multisite custom directory
- What are Attributes used for in a WordPress Multisite?
- How to disable the default WordPress redirect to non-www URLs?
- Bulk theme settings in wordpress multisite
- WordPress with Lan and Wan Access?
- What is the function to get options of the parent site of a multisite network?
- Error uploading files bigger than 58 MB
- Use external database with local multisite
- How to fix blocked cookies error that doesn’t let me log into wp-admin?
- WordPress Multi-Site on Ubuntu 18.04 LAMP Keeps Re-Directing
- How to move 1 WP site from a mult-site environment to a different multi-site area
- Multisite with different domain names on different servers
- WordPress rewrite multisite blog url
- Will changing the folder name two directories above a fresh wordpress installation break the site?
- Register submenu on network menu from the subsite
- What are good approaches to routing some urls to a second WordPress install?
- Multisite Create Site not working
- Why is MySQL receiving such a large serialized object?
- How can I remove the folder from a Multisite URL?
- Custom port problem with local MU installation
- Redirect to another page using contact form 7? [closed]
- How do you update a network option value in the DB via a hook
- MULTISITE SUB-DOMAIN JUST SHOWS INDEX OF -> CGI-BIN INSTEAD OF SHOWING SITE
- Multisite Sub domains not working
- Can’t access Dashboard of a Multisite WordPress. Chrome results in “ERR_TOO_MANY_REDIRECTS”
- How do I get the site url from a Block (within the block editor)
- Update blog option during create new blog?
- Include www prefix in site URL
- 403 forbidden when changing settings on WP Multisite non-main sites
- Multisite on single wordpress
- If statement in wp-config.php, is it possible?
- Cannot access WordPress website from external IP while internally it is working properly [closed]
- Update WP install to WP network & it broke the DB connection
- How to modify wp_config file for set up subdirectory?
- Changing from localhost:8888 to localhost
- Certain lines added to our wp-config.php file are being removed, every day
- Interchanging WordPress Multisite primary site
- Multisite Equivalent of `register_setting`?
- wp option get blogname –url=my-sub-site.com returning main site option
- Add www to the Root Site in WP Multisite Network
- Multisite problem with unexisting paths to CSS etc
- Getting file errors in a WordPress Multisite ADMIN
- local wordpress multisite not working on AWS development server “error establishing database connection”
- There is how to change url domain on some posts?
- WP_SITEURL vs WP_HOME link output
- Working locally with remote DB not working with multisite
- Which action hook to update custom field at network/site-info.php in multisite on update site info
- multisite shared settings
- Blog broken after changing Site/Home URL
- Multisite and plugins options
- No input file specified after enabling multi site
- How do I enable Multisite on WP 3.7.1?
- Pick your brain on wp-config.php if statement for multisite
- Remove blog slug from WPMU?
- How to display update message only to admin
- Advice on WP site structure using multisite
- How to set an option for all sites in my Multisite network?
- I’m getting a 404 NOT_FOUND CODE: ‘DEPLOYMENT NOT FOUND on wordpress multisite installation on my sub domain
- Why the sites dropdown in multi-site installation is different from the list of sites when seen full page?