Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cloudflare redirect subdomain to directory

I am trying to use Cloudflare to redirect:

http://sub.example.com -> http://example.com/sub

But I rather this:

http://sub.example.com -> http://example.com/subdomain

Is this possible?

like image 939
Reverb Avatar asked Sep 19 '14 12:09

Reverb


People also ask

Can you redirect a subdomain?

Under Modify a Subdomain, locate the domain you want to redirect, then click its Manage Redirection link on the right. In the text box, type the URL you would like visitors to be redirected to if they go to the subdomain sample1.hgexample.com. Click Save. You will see the redirected URL under the Redirection column.

Does Cloudflare work with subdomains?

​​ Customize subdomain behaviorEnterprise customers can set up custom settings and access for a specific subdomain within Cloudflare with Subdomain support Open external link . All other customers can set up subdomain-specific Page Rules Open external link to alter Cloudflare settings.


1 Answers

It's possible with Cloudflare Page Rules. In Website Page click on the gear of your site then select Page Rules. Then you can add every pattern you want. Like this for example:

enter image description here

For more information about Cloudflare's Page Rules, take a look at the official site: http://blog.cloudflare.com/introducing-pagerules-url-forwarding/

like image 94
Sky Avatar answered Oct 02 '22 00:10

Sky