I am facing issue of subfolder redirection

Hi there

I’m having an issue whith redirect loop issue on browsers. when I try to access the sub folder by url it’s running multiple loop. The full domain is works perfectly fine but if I access it to another subfolder only then it’s not working.

Hello,

I just checked your site in both Firefox and Chrome, and I don’t see any redirect loop at all. I checked the homepage and saw several inner pages (“subfolder by URL”)… and they all work fine: not a single redirect loop.

Are you still experiencing the problem?

Yes I am, if I try to open “my domain name/back-end/wp-admin” this link then it’s showing ERR_TOO_MANY_REDIRECTS, this is a sub folder which I am trying to access and I have checked properly that there was on error from coding. when I disable the added domain from Cloudflare then it’s working fine. I want to know is there any way to access subfolder after adding the main domain into Cloudflare.

[quote=“rgreen, post:5, topic:565106, full:true”]
Yes I am, if I try to open “my domain name/back-end/wp-admin” this link then it’s showing ERR_TOO_MANY_REDIRECTS, this is a sub folder which I am trying to access and I have checked properly that there was no error from coding. when I disable the added domain from Cloudflare then it’s working fine. I want to know is there any way to access subfolder after adding the main domain into Cloudflare.

I’m not sure I fully understand your setup. As I understand it (please correct any part I’m missing)…

You have a static site for the front end. This static front-end is generated from a WordPress site (the back-end), possibly using the WordPress REST API.

Is this correct? If not please explain your setup a little so I can better assist you.

yes right now the frontend is static and the backend is in wordpress the main issue is I am not able to access the backend folders after setup cloudflare nameserver to my domain. only I am able to access the root folder by heating url.

I am using vue.js for frontend and wordpress for the backend


check this image ERR_TOO_MANY_REDIRECTS

Thanks for the clarification.

Please check the following:

  1. Ensure your WordPress site is using HTTPS, not not HTTP
  2. Ensure your Cloudflare SSL/TLS is set to FULL (Strict)

That should usually handle the redirect loop issue.

1 Like

If you’re running WordPress purely as a headless CMS and your site’s visitors don’t have to interact with WordPress directly at all, then the approach you’re using is not ideal even if you somehow manage to fix the redirect loop.

It’s better to have the WordPress backend at a different hostname (eg subdomain like wp.example.com). You’ll need to setup a separate vhost for this in your web server, and, in Cloudflare, create an A record for the subdomain pointed to the server’s IP address.

Setting up the WordPress back-end under a different hostname has many benefits, including:

  • You can host the two on different servers optimized for each one. For instance, you could host the WordPress backend on a tiny $5 virtual machine, and host the front-end anywhere you can host a static site, including Cloudflare’s Pages, Netlify, GitHub Pages, Versel, or any el-cheapo shared hosting service.

  • You can better optimize the static front-end with more aggressive edge caching, without worrying about breaking WordPress

  • You can completely lock down the entire WordPress back-end.

I have a similar setup for a static site (but using the Ghost CMS instead of WordPress) where the backend runs on my laptop, but the static front-end is hosted with Cloudflare Pages. 11ty glues the two together.

2 Likes

hey GeorgeAppiah Thank You for your help. I have checked that the site is using Https and Cloudflare SSL/TLS is also working fine, so is there any others solution do you have ?

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.