问题原文
原帖链接 · user4358892340 · CC BY-SA 4.0
I am using cloudflare to manage my domain, and I wanted to add a subdomain. I tried to do this:
But it gives me an error. How would I add a subdomain like blog.example.com that sends to example.com/blog ?
已采纳解答
原帖链接 · Simon Hayter · CC BY-SA 3.0
The error you are receiving is because CNAME's only support domain names and not URL paths. You can setup a redirect using your hosting account or Cloudflare Page Rules.
14 Step Cloudflare Process in redirecting traffic from subdomain to main domain using Page Rules:
- Login to Cloudflare
- Use the drop-down menu in the upper left of your screen and click your domain that you want the redirect to take place on.
- Click the DNS icon at the top of the screen.
- Select
CNAMEusing the drop-down options - Add the sub domain in
NAME - Add your domain name in
Domain name - Leave TTL as automatic and Cloudclare enabled, click
Add Recordbutton. - Click Page Rules icon
- Click Create Page Rule button
- Add
alexa.example.com/*in the URL match field - Click + Add a Setting, find
Forwarding URLand click it - Select the status code
301 - Permanent Redirect - Add the Enter destination URL as
http://example.com/alexaSkillDemo - Click Save and Deploy button.
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
