UziForex it's not wrong, but it might not be what you intended.
This will create a permanent redirect from:
http://blitzforex.trade/<something>
http://www.blitzforex.trade/<something>
https://blitzforex.trade/<something>
https://www.blitzforex.trade/<something>
to:
https://blitzforex.trade/public/<something>
It should make Flarum work fine, however:
You still have a public
folder visible. Ideally you don't want it in the url.
If you can't change the Apache document root in your hosting (this is not what happened here) I suggest you follow https://flarum.org/docs/install.html#customizing-paths to get clean paths, instead of using redirects.
And most importantly, your solution might negate the additional security the public folder is supposed to give in the first place. Nothing must be accessible outside of the public
folder. If your server can only be accessed via blitzforex.trade
and www.blitzforex.trade
, the redirects should prevent access. But if you can access the server via another host or its IP, or if you can change the HOST
value of the request and still access your website, an attacker can go around that. If you do keep your current solution, you need to add those 6 commented lines from Flarum's htaccess
to the htaccess
you have in your public_html
folder, before any other rewrite rule.
I tried to keep the explanation short here, I'll probably do an in-depth writing about this at some point.