Have been using and testing Flarum, and I'm already a huge fan. Super easy to use, responsive, lots of features, it's great!

Here's my current problem. I originally installed it at a subfolder of a domain to test it: http://forum.mydomain.com/flarum

After testing and setup, I'd like to be able to access it from the root of the site. I've tried changing the config file and changing the web root folder on my host, but I think the database refs must point to the directory folder so the site doesn't work. I'm assuming that if I move all files to the root this DB problem will just persist.

Any tips on how to move or configure this site so it's accessible from root? Thanks so much for any tips. ?

    Are you trying to move to forum.mydomain.com or to mydomain.com?

    Make sure the url field in your config.php is correct.

      jordanjay29 I'm trying to move it to the root of the subdomain, from forum.mydomain.com/flarum to forum.mydomain.com.

      The url field in my config file is currently forum.mydomain.com/flarum, which works as the site is at /flarum. However, I want to move the forum to forum.mydomain.com (or, even better, not move it but have it accessible from forum.mydomain.com) and just changing the url in the config file to "http://forum.mydomain.com" doesn't have any effect. Sorry if I wasn't clear enough!

      maybe like a this ?

      http://prntscr.com/b6znn2

      You need add virtual host to /etc/apache2/sites-available/default.conf

       <VirtualHost *:80>
       ServerName forum.example.com
       DocumentRoot /var/www/forum.example.com
       <Directory "/var/www/forum.example.com">
            AllowOverride All
       </Directory>
       </VirtualHost>

      and add http://forum.example.com to config.php

      Weeboo Huh, interesting! I'm on a shared host unfortunately and don't have a default.conf file, I think because a shared host has limited access to Apache options. Can this be overridden in .htaccess?

      You have access to the root?
      I use .htaccess to drive to the folder forum.example.com

        You can try just to the root directory, add .htaccess file

        Redirect 301 / http://forum.example.com/

        then make a folder forum.example.com and add files flarum

        jordanjay29 The .htaccess of forum.mydomain.com is empty ... everything is in the .htaccess of forum.mydomain.com/flarum:

        # Allow access if Flarum is installed in a subdirectory,
        # but another .htaccess in a higher directory denies access.
        
        <IfModule mod_authz_core.c>
          Require all granted
        </IfModule>
        <IfModule !mod_authz_core.c>
          Order Allow,Deny
          Allow from all
        </IfModule>
        
        <IfModule mod_rewrite.c>
          RewriteEngine on
        
          RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
        
          RewriteRule ^vendor/(.*)?$ / [F,L]
          RewriteRule ^storage/(.*)?$ / [F,L]
          RewriteRule ^config.php$ / [F,L]
        
          RewriteRule ^api(.*)$ api.php [QSA,L]
          RewriteRule ^admin(.*)$ admin.php [QSA,L]
        
          RewriteCond %{REQUEST_FILENAME} !-f
          RewriteCond %{REQUEST_FILENAME} !-d
          RewriteRule !^assets index.php [QSA,L]
        
          # MultiViews can mess up our rewriting scheme
          Options -MultiViews
        
          # Autoindex will list all assets files which is not so good
          Options -Indexes
        </IfModule>
        
        <IfModule mod_deflate.c>
          # Compress all output labeled with one of the following MIME-types
          <IfModule mod_filter.c>
            AddOutputFilterByType DEFLATE application/atom+xml \
                                          application/javascript \
                                          application/json \
                                          application/vnd.ms-fontobject \
                                          application/x-font-ttf \
                                          application/x-web-app-manifest+json \
                                          application/xhtml+xml \
                                          application/xml \
                                          font/opentype \
                                          image/svg+xml \
                                          image/x-icon \
                                          text/css \
                                          text/html \
                                          text/plain \
                                          text/xml
          </IfModule>
        </IfModule>
        
        # Configure cache expiry for different file types
        <IfModule mod_expires.c>
          ExpiresActive on
          ExpiresDefault                                      "access plus 1 second"
        
          ExpiresByType text/css                              "access plus 1 year"
          ExpiresByType application/json                      "access plus 0 seconds"
          ExpiresByType application/xml                       "access plus 0 seconds"
          ExpiresByType text/xml                              "access plus 0 seconds"
          ExpiresByType image/x-icon                          "access plus 1 week"
          ExpiresByType text/html                             "access plus 0 seconds"
          ExpiresByType application/javascript                "access plus 1 year"
          ExpiresByType application/x-web-app-manifest+json   "access plus 0 seconds"
          ExpiresByType text/cache-manifest                   "access plus 0 seconds"
          ExpiresByType image/gif                             "access plus 1 month"
          ExpiresByType image/jpeg                            "access plus 1 month"
          ExpiresByType image/png                             "access plus 1 month"
          ExpiresByType application/atom+xml                  "access plus 1 hour"
          ExpiresByType application/rss+xml                   "access plus 1 hour"
          ExpiresByType application/font-woff2                "access plus 1 month"
          ExpiresByType application/font-woff                 "access plus 1 month"
          ExpiresByType application/vnd.ms-fontobject         "access plus 1 month"
          ExpiresByType application/x-font-ttf                "access plus 1 month"
          ExpiresByType font/opentype                         "access plus 1 month"
          ExpiresByType image/svg+xml                         "access plus 1 month"
        </IfModule>

        I think I see where you're going with this; the .htaccess in the root of the site is denying access?

        Try adding this to your .htaccess on the root of the forum.mydomain.com.

        Edit: the forum doesn't like special formatting. Use this pastebin as the example:

        Replace the "mydomain" on the RewriteCond with your main domain name.

          amiller030 Thanks for the suggestion. When I replaced the root .htaccess with your example (substituting in the domain for mydomain.com) I get the following error on forum.mydomain.com:

          Cannot GET http://forum.mydomain.com/

          Any idea what's going on here?

          Weeboo I'm not sure I understand what you mean. Do you mean I can't do this through .htaccess, but instead need to edit the Apache config file?

          Weeboo Sorry, I still don't really understand what you mean. Do you mean a virtual host as in a VPS? Or is there a way to add a virtual host on a shared server?

          best if you gave the name of your domain, then I'll try to help you

          Sorry, I'm not willing to post a domain that I'm working on to a public forum. I don't see why forum.example.com or similar isn't sufficient, I just need to understand what you're suggesting I do with the .htaccess file, and whether I can do this on a shared server or you're saying it's only possible with a VPN.

          electrolyte Can you provide some more details of what exactly "doesn't work" after trying to move to the root directory and changing the config file? It's hard to guess...

          I'm reasonably sure that once we have more information, this will be easy to solve.