I want to redirect all my pages and video content to my sub domain (where I have my CDN)
currently I have link in a videogame, with people who generate traffic and I have a lot of link already in the game that I cant change since it will take forever, so I want redirect all people that will click on the link to my sub domain, where I have my CDN setup
https://exemple.com/folder/contents/video.mp4 TO https://cdn.exemple.com/folder/contents/video.mp4
I already try few rewrite command with htaccess but I get the error TOO_MANY_REDIRECT
and I don't know what to do
This should work for you:
RewriteEngine on
RewriteCond %{HTTP_HOST} ^(www\.)?domain\.com$ [NC]
RewriteRule ^(.+\.mp4)$ https://cdn.exemple.com/$1 [R,L]
Put this at the top of your /root/.htaccess
before other rules and make sure to Clear your browser cache before testing this new redirect.
ERR_TOO_MANY_REDIRECTS
I still get the same error@RootBeer what URL is causing this error?
When I set the rewrite rules, the redirection of
https://exemple.com
tohttps://cdn.exemple.com
make the "ERR_TOO_MANY_REDIRECTS" , but when I don't have any rewrite rules, my cdn sub domain work fine@RootBeer The rule is working fine for me and it should not cause this infinite redirect error. Are there any other rules that can conflict with this one?
No, only this one