apache - Rewrite folder to subdomain with htaccess for cross domain issues -
i've followed instructions in rewrite folder subdomain , i'm running problem
rewriterule ^cdn/([^/]+)/?$ http://cdn.example.com/ [nc,r=301,l]
i'm expecting example.com/cdn/... redirect cdn.example.com instead it's redirecting cdn.example.com/cdn/.. doesn't me.
this attempt around cross domain issues. can let me know how make rewrite how need it, , if solve video cross domain issues?
you lack $1 @ end of rewriterule. need rules cdn. subdomain tell content in cdn folder:
rewriteengine on rewritecond %{http_host} ^cdn\.example.com$ [nc] rewriterule ^cdn - [l] rewritecond %{http_host} ^cdn\.example.com$ [nc] rewriterule ^(.*)$ cdn/$1 [l,nc] rewritecond %{http_host} ^(www\.)?example.com$ [nc] rewriterule ^cdn/([^/]+)/?$ http://cdn.example.com/$1 [nc,r=301,l]
Comments
Post a Comment