roots / multisite-url-fixer Goto Github PK
View Code? Open in Web Editor NEWFixes WordPress issues with home and site URL on multisite when using Bedrock
License: MIT License
Fixes WordPress issues with home and site URL on multisite when using Bedrock
License: MIT License
I'd like to request a bit more info in the readme.
I am not sure how to install it, whether it should be
Any info is appreciated.
After user register and created new subdomain (sub-site), they were sent an activation email. However, the url for activation seems not using the /wp/
fix.
To activate your blog, please click the following link:
http://aman.kakiproperty.test/wp-activate.php?key=87ee9bcc62822257
After you activate, you will receive *another email* with your login.
After you activate, you can visit your site here:
http://aman.kakiproperty.test/
Is the filter priority was later than this?
Hi,
First of all thanks for your really helpful tool!
I'm running into an annoying problem with URLs in a subdomain based multisite WP install. On the main site, no problem because it's the root URL but on all other sites, all dynamic URLs (based on the "content_url()" function) are wrong because they're based on root domain instead of subdomain.
All assets for example have a URL like
instead of
This is due to the definition of the WP_HOME constant with a unique domain.
I've done a fix based on the 'content_url' filter
<?php
add_filter('content_url', 'wp_subdomain_url_fixer', 10, 2);
function wp_subdomain_url_fixer($url, $path)
{
$network = get_network();
$current_site = get_blog_details();
// Security replace subdomain by domain
// (should never do anything but will avoid subdomain.subdomain.domain if it does)
$url = str_replace($current_site->domain, $network->domain, $url);
// Replace domain.com by subdomain.domain.com
$url = str_replace($network->domain, $current_site->domain, $url);
return $url;
}
Please let me know what you think about it and feel free to incorporate it in your url fixer addon.
Thanks.
Hi, maybe I got something wrong, but I thought the stylesheets and plugin files URLs would be fixed by your plugin.
But if you look at the source of this site : https://casas-turquesa.com/, you will see a lot of URLs like this :
https://campo-de-arroz.com/app/plugins/contact-form-7/includes/css/styles.css?ver=5.0.2
https://campo-de-arroz.com being the main domain of the multisite.
Can you help? Did I do something wrong?
Add support for multisite installs with sub dir install instead of subdomain.
e.g.
This issue seems to have quite some history and seems to be fixable using (Nginx) rewrite rules looking at https://discourse.roots.io/t/working-subdirectory-multisite-nginx-rules/1503
I'm probably not the only one that had to spend quite some time trying to figure out how to get this working with Bedrock. Having this within the multisite URL fixer (if possible) would save quite some headache.
This feels more like a bug to me than a feature request. Since it's fixable with rewrite rules I thought it to be an enhancement. With the rewrite rules in place, I now wonder if this plugin is needed at all.
I usually set up multisite without subdomains and use one site per language :
For main site, wp-admin is accessible at example.com/wp/wp-admin.
For the other site, I get to example.com/en/wp/wp-admin and get a Page not found. If I try example.com/en/wp-admin, the admin seems to load, although the page is unstyled (no css).
Someone can reproduce that?
I'd be happy to look for a fix.
Hi,
is there a reason this requires php 7?
If not would it be possible for you to lower the version in the composer.json file as i'm getting the following error.
- roots/multisite-url-fixer 1.0.0 requires php >=7.0.0 -> your PHP version (5.6.14) does not satisfy that requirement.
I have wordpress multisite install with custom domain for each site, except main. When I click on publish button in customizer at custom domain site, wordpress notify me "You need a higher level of access" and in dev console show response from admin-ajax.php: data: "invalid_nonce", success: false
. If I deactivate "Multisite URL Fixer" customizer works great, but links to network parts wrong and can't upload images.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.