• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Question Sub-domain rewrites to sub-folder

bulent

Regular Pleskian
Hi,
I have personal project where I will use discourse community forum on second vps on subdomain forum.example.com
My main site example.com will be hosted on vps with plesk onyx.
Is there easy way to make some rewrite rules and make forum work on example.com/forum
 
IgorG's code sample is correct. What exactly does not work when you try this? Have you placed it into your .htaccess file of example.com before other rewrite statements? What happens in access_log and error_log files when you open your example.com website after that change? Have you considered that the code refers to example.com, but not www.example.com?
 
Last days I was busy and now had some time to check it again and it works.

At the moment when I write www.example.com/forum it redirects to forum.example.com
when I write www.example.com/forum/some-topic it redirects to forum.example.com/some-topic

But what I want the forum to be in sub-domain (it's hard to install discourse on plesk, so it's on another VM) and with rewrite rules I want to have www.example.com/forum/... URLs
Probably I did not define the question right. Maybe I should call it forwarding..

For better SEO I want all power to go to main domain.
 
For better SEO I want all power to go to main domain.
Sorry, you might consider to inform yourself, because Google for example will wheanwhile treat the subdomain as part of the main domain ( when run by the same person/company ). Just make sure to:
  • Use the same "copyrights statements" on both sites.
  • Use the same "privacy policies" on both sites.
  • When you use a "contact"/"about us" - page, make sure that they don't differ.
  • Place links at your main - domain to your subdomain and backwards as well.
  • Register not only your main - domain at the "Google Webmaster Tools", but as well the subdomain.
 
Back
Top