Redirecting an example.com/files/dl/file.pdf to files.example.com/file.pdf

I need for pdf files that are located on a subdomain (https://files.example.com/file.pdf) to be reachable using a link (https://example.com/files/dl/file.pdf)

The subdomain is hosted by a different host/server/ip address than the TLD.

I am able to access the pdf files when I navigate directly to the subdomain.

I set up a redirect rule for https://example.com/files/dl/file.pdf to redirect to files.example.com/file.pdf.
Did not work out.

I set up a Bulk Redirect list and rule to handle this.
No love there either.

I do not know what I am missing or doing incorrectly. I will be very grateful for any assistance anyone can offer!

Can you show what redirect rule you created and some examples of the real links you want to redirect from and to so it’s easier to test and see what is not working?

1 Like

Did you save that rule as pictured? Obviously you have a dummy filename in there but is the redirect to that dummy file actually saved? (I’m trying to see if the redirect actually works, which at the moment it doesn’t).

curl -I https://sheevaunmoran.com/files/dl/fake_example_file.pdf
HTTP/2 404
date: Tue, 14 May 2024 16:02:18 GMT
content-type: application/json
x-powered-by: Express
vary: Accept-Encoding, Accept-Encoding
x-cloud-trace-context: d22f6fcc8d2d545a93b01784374f0d7e
cache-control: private
via: 1.1 google
cf-cache-status: MISS
server: cloudflare
cf-ray: 883c1ca00c1a9431-LHR

Do you just have a few files to redirect for or a large number? If a large number, either bulk redirects or a dynamic redirect rule would be better.

And this is what the bulk redirect list looed like

There are 15 files in the directory that need to be downloadable.

I actually created a pdf with that file name and dropped it in the directory so it does exist.


The rule is active and the file does exist In the appropriate directory.

I feel like it must be something really obvious that I am missing but I cannot seem to figure out what it is.

What A/AAAA IP address do you have for sheevaunmoran.com? If it is to a host that uses Cloudflare (although your records are proxied, so I’d expect them not to work if your host was using Cloudflare in that case), then redirects don’t take over from records where a Cloudflare IP is used.

The A record is pointing to a GoHighLevel account which is hosting the pages for sheevaunmoran.com.
When adding the domain to the GHL account you are given an IP address, but no IPV6 address, so there is no AAAA record.

It is entirely possible that GHL may use Cloudflare. If this is the case, would changing the A record to DNS only fix the issue?

GHL use Cloudflare, so you will need to set up any redirects with them. Setting to “DNS only” is recommended when using GHL, but it won’t make your redirects on Cloudflare work as requests for your site aren’t passing through your account.

1 Like

The issue that I run into when setting redirects in GHL is they do not allow for “multi-level paths”.

/files/dl/
Cannot add multilevel paths! remove / from path

So I am trying to find a workaround. I was really hoping Cloudflare would be able to offer a solution.

If you (or anybody out there reading this post) have any creative ideas for how to accomplish this, I humbly request that you use the reply button to show off your skills and consequently resolve this migraine-inducing issue for me.

If the host is using Cloudflare, then for most users, requests cannot pass through your own Cloudflare account settings first and will route direct to the host’s Cloudflare account…

1 Like