<![CDATA[ Rewrite Rule for Subdomain on Modx Cloud Nginx - MODX Community Forums]]> https://forums.modx.com/thread/?thread=102219 <![CDATA[Rewrite Rule for Subdomain on Modx Cloud Nginx]]> https://forums.modx.com/thread/102219/rewrite-rule-for-subdomain-on-modx-cloud-nginx#dis-post-550773
if ($host = "hub.mydomain.com") {
  rewrite ^ https://www.mydomain.com/pages/solutions/hub/index.html permanent;
}


This works.

However I was wondering how to (or if there was a way?) redirect to a sub folder on that domain?

if ($host = "hub.mydomain.com/save") {
  rewrite ^ https://www.mydomain.com/pages/solutions/hub/save/index.html permanent;
}


This does NOT work. Trying to figure out a solution?]]>
smorris May 15, 2017, 03:05 PM https://forums.modx.com/thread/102219/rewrite-rule-for-subdomain-on-modx-cloud-nginx#dis-post-550773
<![CDATA[Re: Rewrite Rule for Subdomain on Modx Cloud Nginx (Best Answer)]]> https://forums.modx.com/thread/102219/rewrite-rule-for-subdomain-on-modx-cloud-nginx#dis-post-550810
location ~ ^/save {
    return 301  https://www.mydomain.com/pages/hub/save/index.html;
}
]]>
smorris May 16, 2017, 03:10 PM https://forums.modx.com/thread/102219/rewrite-rule-for-subdomain-on-modx-cloud-nginx#dis-post-550810