• Support
  • Oops! Something went wrong.... again

maleficmax No, just a redirect from www to https://yourdomain.top/forum.

In your .htaccess file, after RewriteEngine on, add something like this:

RewriteCond %{HTTPS} off [OR]
RewriteCond %{HTTP_HOST} ^www\. [NC]
RewriteRule ^ https://yourdomain.top%{REQUEST_URI} [L,NE,R=301]

There are some more explanation on what it does here: https://simonecarletti.com/blog/2016/08/redirect-domain-http-https-www-apache/

    andreherberth
    And it did not work. After adding these lines after RewriteEngine on forum stops loading and browser shows me error about wrong redirection. I checked and rechecked redirect lines, they must be OK. Read the blog entry and everything seems to be fine, but here we are.

    But redirect works, error is showed when adress line shows adress without www in it 🙂

    UPD. This should be added in the forum's htaccess or in the root .htaccess of the whole site?

    After pressing "Log In" I can see 400 Bad Request error in browser log while requesting https://(mysite).top/forum/login URL

    If I try to go to https://(mysite).top/forum/login directly, I (of course) get a MethodNotAllowedException, but have an interesting info in details:
    REDIRECT_SCRIPT_URI http://(mysite).top/forum/login
    SCRIPT_URI http://(mysite).top/forum/login
    (HTTP, not HTTPS here!)
    Is ot OK?

    My htaccess code above was to ensure that visitors would always use the address from your config file.

    Right now, visiting your site, I get this debug message:

    GET https://yoursite.top/forum/api/posts?filter%5Buser%5D=2&filter%5Btype%5D=comment&page%5Blimit%5D=20&sort=-createdAt
    
    <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
    <html><head>
    <title>404 Not Found</title>
    </head><body>
    <h1>Not Found</h1>
    <p>The requested URL /forum/api.php was not found on this server.</p>
    </body></html>

    I managed to register successfully though, so the forum is working.
    So, to me this indicate a rewrite error.

    I would not be surprised if you have an htaccess file in your root folder that could potentially override something in the forum folder.

    Contact me on discord if you want further help 🙂

      maleficmax I previously used beta 7, it worked good.

      Beta 8 changed the layout of the directory structure and rewrite rules. The beta 8 release notes contains all the information about these changes. If you are still trying to use the rewrite rules or layout of beta 7 for a beta 11 Flarum install it will not function properly.

      andreherberth
      This is very weird. I successfully logged in from another browser. So I deleted all the data from my site in my main browser and... logged in. What the hell was that? I cleaned cache, i reloaded forum many times.
      Thank you for your help!
      If it suddenly stops working, I will come here to ask you, with your permission 🙂

      4 years later

      andreherberth

      I know that this post is old, but this solution saved me. I could not login, icons were not loading...
      Thank you for the tip.

      Steve33 please start a new support discussion with information about your forum if you need assistance. Start here https://docs.flarum.org/troubleshoot

      Information in this thread is very old, but it seems to have been a classic case of inadvertently making a forum accessible through multiple domain names, which isn't supported by Flarum. There are many solutions that depend on the kind of hosting being used.