Redirect a subdomain url that has a CNAME

自闭症网瘾萝莉.ら 提交于 2019-12-11 15:04:22

问题


I am looking to 301 redirect a single url on a subdomain to a url on the root domain. Eg:

'sub.domain.com/page' to redirect to 'domain.com/work/name'

I do not want to affect any other pages on the subdomain, the subdomain should operate as normal, aside from that one specific url.

The subdomain also has a CNAME record with the value 'shopname.bigcartel.com'

I tried the .htaccess suggested in my previous question here, but that was before I knew there was also a CNAME record active.

How can I achieve the redirection?

Thanks in advance. Darrell


回答1:


Add such strings to .htaccess in root of sub.domain.com, not in root of domain.com

RewriteEngine On
RewriteRule ^page$ http://domain.com/work/name [L,R=301]

Must work



来源:https://stackoverflow.com/questions/29954555/redirect-a-subdomain-url-that-has-a-cname

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!