Proxy redirect to another WordPress site

Hi, we are going to have a new wordpress website. We currently have the main website (built using jekyll) on Netlify with www.parent.com main domain. We want to have a subfolder path www.parent.com/stepchildren to point to another website built with self-hosted wordpress (stepchildren.parent.com). I have few questions:

  1. Is this possible, since the other website is on wordpress and not another repo on netlify?
  2. If answer to question #1 is no, how can we achieve this? any recommendation?
  3. For SEO purposes, will the proxied wordpress website on www.parent.com/children will be indexed by search engines under the same www.parent.com domain?

The goals are to have both sites with the same domain (not subdomains) and for SEO purposes.

These are some resources that I’m looking at for now

Thank you

p/s: these are not actual domain names

@shafiemukhre Welcome to the Netlify community.

I’ve been able to do this using external DNS, but not with Netlify DNS. For this to work, your WordPress install has to have its own separate domain / subdomain, though.

For example, I have site called gregraven.online, which is hosted on Netlify but with NameCheap name servers.

I have another site called nointervention.wpengine.com. I added wp.gregraven.online as one of the domains through the WPEngine dashboard.

Then in NameCheap, I set up a subdomain called wp.gregraven.online, with a CNAME entry pointing at wp.gregraven.online.

When I visited wp.gregraven.online, it displayed the content from nointervention.wpengine.com, but left gregraven.online and www.gregraven.online untouched.

I’ve disassembled this now (I just created this as a test so I could better answer your question), but if memory serves I’ve created similar setups for other non-Netlify sites using external (NameCheap, Epik, etc.) name servers.

Hope this helps.

Thank you @gregraven. We are going to use WP Engine as well for hosting the WordPress site. From your explanation, I can see that this will work for subdomains. I just don’t know whether this will work for subfolder path on main domain.

To use your example, can I add greggaven.online/wp on WPEngine dashboard. Then in NameCheap, I added greggaven.online/wp with CNAME entry pointing to greggaven.online/wp

The expectation is when I visit greggaven.online/wp, instead of getting 404 page not found, it will display content from nointervention.wpengine.com. Is this possible?

I also got another advice that this might be possible is to use .htaccess in the nointervention.wpengine.com file to point the DNS to the sub directory of the greggaven.online. I’ve yet to try this and want to know if this is even possible in the first place before create a POC for it

@shafiemukhre Depending on how you want the URL to display in the browser, I would think you could accomplish this with an instruction in your _redirects file.

I want the URL to show main domain with subfolder path. For example, when I typed greggaven.online/wp in the browser, it will show the page of nointervention.wpengine.com, greggaven.online/wp/blog will show nointervention.wpengine.com/blog and so on. The browser will show the URL of the main domain greggave.online/wp/* but displays the pages from WordPress.

I have tried this Can I deploy multiple repositories in a single site? and it works but in this case, the second website is in another repo and also hosted on Netlify. If you are referring to this, I don’t think this _redirects file approach will work on my case with another WordPress site on WP Engine.

“I would think you could accomplish this with an instruction in your _redirects file.” ← If you are referring to another approach (not the above), can you share with me how to do that? Please feel free to correct my understanding as well

@shafiemukhre OK, I just recreated this, pointing a subdomain from a static site on Netlify – nointervention.gregraven.online – at the apex domain of a WordPress site on WPEngine.

To accomplish this, I added nointervention.gregraven.online as a domain in the WPEngine dashboard for this site. I also added a CNAME entry with NameCheap that points the nointervention.gregraven.online to nointervention.wpengine.com. Finally, I added an instruction in _redirects to route all requests to nointervention to WPEngine.

Type in nointervention.gregraven.online or gregraven.online/nointervention and you are shown content from nointervention.wpengine.com, but with nointervention.gregraven.online in the URL section in the browser.

The only thing I haven’t fixed is that requests to nointervention.gregraven.online are delivered over HTTP instead of HTTPS.

The proof is left to the reader.

Hi @gregraven, thank you for your replies previously! It gave me confidence to do this. I have added below redirect rule in _redirects file:

/subsurface2/* http://subsurface2.dremio.com/:splat 200!

This work but only for one page (the homepage on WordPress site). If I go to https://dremio.com/subsurface2/contact, somehow it will forced to 301 redirect and the browser url will change to Contact Us | Dremio. I don’t want this.

The second issue is, css and js is not rendered properly because the wordpress site is on http. After I changed it to https by adding SSL. The 200 redirect from https://dremio.com/subsurface2 will be forced to 301 redirect towards https://subsurface2.dremio.com and the browser will show the subdomain instead of subfolder path on apex domain.

You previous latest example was the other way around (APEX domain on WordPress). While in our case, the APEX domain www.dremio.com is on Netlify. I can see that only gregraven.online/nointervention correctly 201 redirect but the rest remains on nointervention.wpengine.com.

I am looking forward to hearing your thoughts on this @gregraven and how to achieve the goal since it is not successful yet for now on my side

Hey there, @shafiemukhre :wave:

It looks like this thread has been quiet for the past 7 or so days. Are you still experiencing issues? If so, what additional steps have you taken since you last posted? If this has resolved, please share your solution with us :slight_smile: