GithubHelp home page GithubHelp logo

roots / multisite-url-fixer Goto Github PK

View Code? Open in Web Editor NEW
57.0 57.0 18.0 9 KB

Fixes WordPress issues with home and site URL on multisite when using Bedrock

License: MIT License

PHP 100.00%
bedrock wordpress-plugin

multisite-url-fixer's People

Contributors

julienmelissas avatar retlehs avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

multisite-url-fixer's Issues

Request for bit more info in readme

I'd like to request a bit more info in the readme.

I am not sure how to install it, whether it should be

  • in my projects composer.json (which I did, but didn't notice a difference)
  • download and unpack the zip and drop it in mu (created errors)
  • or do i need to run a separate composer install for this plugin ?

Any info is appreciated.

URL not fixed in email sent to user

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?

Subdomain based multisite installation frontend URLs

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

http://maindomain/wp-content-dir/asset

instead of

http://subdomain.maindomain/wp-content-dir/asset

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.

Multisite subdir install

Summary

Add support for multisite installs with sub dir install instead of subdomain.
e.g.

  • domain.com (primary site, "site1")
  • domain.com/site2

Motivation

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.

Additional context

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.

Can't access sites wp-admin other than / when not using subdomains in multisite install

I usually set up multisite without subdomains and use one site per language :

  • example.com/ (French)
  • example.com/en (English)

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.

Why ? "php": ">=7.0.0"

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.

Insufficient rights in customizer at wordpress multisite install with custom domains

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.