I want to redirect from example.org
to subdomain.example.org
My domain is registered with GoDaddy and hosted on a StackCP server with a One-Click Install of Flarum.
If I go to example.org
it takes me to subdomain.example.org/public_html/
where I get a notice saying The page you requested could not be found
together with a link that takes me to subdomain.example.org
which then correctly displays my forum.
So I tried modifying the .htaccess
file in the root directory of my account by adding the following code from this answer here.
RewriteEngine on
RewriteCond %{HTTP_HOST} ^example.org [NC,OR]
RewriteCond %{HTTP_HOST} ^www.example.org [NC]
RewriteRule ^(.*)$ http://subdomain.example.org/$1 [L,R=301,NC]
However, doing so made no difference.
I added the code like this:
#+PHPVersion
#=(removed just in case)
AddHandler x-httpd-php83 .php
#-PHPVersion
RewriteEngine on
RewriteCond %{HTTP_HOST} ^example.org [NC,OR]
RewriteCond %{HTTP_HOST} ^www.example.org [NC]
RewriteRule ^(.*)$ http://forum.example.org/$1 [L,R=301,NC]
#+WebsiteRedirect
#=[]
RewriteEngine On
RewriteOptions InheritBefore
#-WebsiteRedirect
#+Unmarked
#EOF
#-Unmarked
#EOF
I also tried copying the modified .htaccess
file to my public_html
directory, but it made no difference.
Can anyone please help me with this?