I'm hosting a forum and have recently decided to move it to a sub-domain instead.
As such, I moved all the forum files in to var/www/forum
and I can access the forums just fine through this directory, i.e example.net/forum
.
I've also set up the sub-domain in my apache virtual host so that if I go to forum.example.net
it will display the forums to me and this also works fine.
All I need to do now is set up a .htaccess to redirect people using the directory URL example.net/forum
to forum.example.net
.
This answer gets me close, but not quite there as it will continually redirect me.
Ideally I'd like to carry their request over too, e.g example.net/forum/viewtopic.php?example
gets redirected to forum.example.net/viewtopic.php?example
.
Throughout my search for the answer, mod-rewrite may work but I am not too sure how to implement it.
Any help would be appreciated.