• Aimee

    (@greatdanemaniac)


    I’ve been trying to get this to work all day. I’ve tried adding stuff to my .htaccess file, but to no avail. My blogs however on stand alone domains, like the top domain and another can have registered blog profiles.

    The ones with the structure like domain.com/en and domain.com/sv are not found.

    I added this to my .htaccessfile and it worked – for one site, but not for all of them:

    RedirectMatch "^\/.well-known/(webfinger|nodeinfo|x-nodeinfo2)(.*)$" /sv/.well-known/$1$2

    I do use Let’s Encrypt and I’ve googled and found out that it’s a huge problem, but the solutions for that have not worked for me.

    I’ve installed 3 plugins, activitypub, webfinger and nodeinfo.

    Thanks for any fast help with this.

Viewing 10 replies - 1 through 10 (of 10 total)
  • Plugin Author Matthias Pfefferle

    (@pfefferle)

    ooof… this is a really tricky one!

    The plugin is not build with that case in mind, at least not without some major tweaking.

    Can you maybe explain your expectations a bit more? Like for example what do you expect how the profile URLs look like?

    Thread Starter Aimee

    (@greatdanemaniac)

    Sure!

    I expect that when I write a post on either blog i.e domain.com/en that the post will end up on the fediverse. People who know of my blog profile will follow it, hopefully like and comment, and the comments end up as comments on the blog.

    I have blog profiles set up for all the sites and they all share the same structure, aka @[email protected], @[email protected] etc.

    When I tried that regexmatch I mentioned and put in my Swedish site, it worked for that site, but I don’t know if it’s possible to have it match all subfolder structures? I’m not the best at regex, so any help is useful.

    I was thinking if it could work with something like this:

    RedirectMatch "^\(.*)/.well-known/(webfinger|nodeinfo|x-nodeinfo2)(.*)$" /$1/.well-known/$2$3

    I’ve already tried exatly that example above to no avail, got a 503 the second I searched for my blog profile on mastodon.

    Plugin Author Matthias Pfefferle

    (@pfefferle)

    OK, I understand! This will not work with a simple rewrite on .htaccess level, because this way, you can only forward the request to one blog!

    What you describe, would require a dedicated WebFinger setup that handles blogs in subfolders as users, that means you have to rewrite requests based on the resource (https://domain.com/.well-known/webfinger?resource=acct:[email protected] should rewrite to https://domain.com/en/.well-known/webfinger?resource=acct:[email protected] ) and in the blog, you have to set the blog wide user to [email protected] and to disable “authors”.

    Thread Starter Aimee

    (@greatdanemaniac)

    Ok! I can try using the redirection plugin I have for that. It works on both a WordPress level and Apache in .htaccess file. I shall try and get back to you.

    Thread Starter Aimee

    (@greatdanemaniac)

    Does not seem to work.

    I guess that I must have a top level domain for all my sites for this to work? I do have that option, but I’ve promised myself and my readers to not fiddle with domains any longer, since I’ve done that too many times and people will get tired of me and my blogs all together if I break that promise.

    This is also true if I took the route of subdomains as well. I’ve promised not to change the structure of the blogs at all from now on.

    If I can’t get this to work, I’m gonna have to post my stuff to the fediverse in some other way. I only have like 4 followers anyways…

    Thread Starter Aimee

    (@greatdanemaniac)

    Any ideas on how I can get this to work?

    It’s been confirmed that it works with subdomains, but I have not changed to that yet. Somebody on Mastodon said that I could change to subdomains, but redirect to my current subdirectory structure.

    Aka I can have the subdomains like sv.domain.com but all posts and pages can still look like domain.com/sv/blogg/my-post.

    How do I do this correctly? I use the redirection plugin for this, and I understand regex somewhat, so I could use some thourough instructions on how it will work.

    Or I’ll just go back to mapped domains for my subdirectories. It’s a thing I’m contemplating after all…

    Plugin Author Matthias Pfefferle

    (@pfefferle)

    Some more context here: The plugin works if you have one blog in a subdirectory, because then it is a fairly straight forward redirect thing.

    If you have several blogs in several subdirectories, then you have the issue, that you have to redirect based on the identifier.

    For your setup, you have the problem, that the identifiers of all your blogs look the same. User author on domain.com/sv/ looks like @[email protected] , but it looks the same on domain.com/en , because WebFinger does not support subdirectories. This is sadly not a problem of the Plugin (because we could fix it then), but that the spec does not support it.

    So, redirecting the subdomains will only work if the user profile would be [email protected] .

    So it is not about the post-URLs (they can be in subdomains, subfolders, …), but the User-Profile URLs/Identifier.

    I hope this helps and makes sense. Sorry if this is a bit complex, but this is mainly because the spec (and Mastodon) is very restrictive.

    Thread Starter Aimee

    (@greatdanemaniac)

    Ok, thank you for your reply.

    I’ll see if I can create something of a subdomain or something else for that. Perhaps there’s a plugin I could use so that a sub-site of a multisite can have multiple domains?

    Otherwise I’ll just start using my domains I have for my sites, even though it’s a huge hassle to do so.

    I just want to post my solution that’s working for me in nginx.

    Setup
    I have two sites, one in example.com and the other one in example.com/en/.

    The first domain is setup as [email protected] for my German content, the second one is setup as [email protected].

    Redirection
    You need to redirect two URLs for the second site:
    /@example-en (from the first site without the /en/!)
    /.well-known/webfinger/?resource=acct:[email protected]

    Both URLs need to be redirected to the subfolder /en/, which looks like this in nginx for me:

    location ~ ^/\@example-en {
            return 301 $scheme://$server_name/en/@example-en;
    }
    
    location ~ ^/.well-known/webfinger {
            if ( $query_string = "resource=acct:[email protected]" ) {
                    return 301 $scheme://$server_name/en/.well-known/webfinger?resource=acct:[email protected];
            }
    
            try_files $uri $uri/ /index.php?$uri&$args;
            include /etc/nginx/proxy_params;
    }

    Maybe that helps, I’m not that familiar with Apache nor have I one running and thus cannot provide a full depth answer how to rewrite it there.

    Thread Starter Aimee

    (@greatdanemaniac)

    Thank you @kittmedia!

    I will check it out. I do run my setup on apache, but I guess the redirects are the same in both nginx and apache.

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘My multisite subfolder installed blogs are not found’ is closed to new replies.