adamshields
asked on
Redirect folder content to CDN using mod_rewrite
I would like to redirect content that is placed onto our CDN using mod_rewrite. The following rule is not working correctly. I only want content in a specified folder to redirect and not the root or entire domain.
This tries to use the CDN for every file requested and not just the files that would appear to come from the dl folder which is not desirable. Also when going to www.domain.com/dl/file.zipĀ I am redirected to http://c0002.cdn1.cloudfiles.rackspacecloud.com//dl/file.zip, notice the addition of the /dl/
Here is the example I was following: http://se.id.au/journal/files/mosso_cloudfiles_with_own_domain.php
RewriteCond %{REQUEST_URI} !^/dl/$
RewriteRule ^(.*)$ http://c0002.cdn1.cloudfiles.rackspacecloud.com/$1 [R=302,L]
This tries to use the CDN for every file requested and not just the files that would appear to come from the dl folder which is not desirable. Also when going to www.domain.com/dl/file.zipĀ I am redirected to http://c0002.cdn1.cloudfiles.rackspacecloud.com//dl/file.zip, notice the addition of the /dl/
Here is the example I was following: http://se.id.au/journal/files/mosso_cloudfiles_with_own_domain.php
ASKER
It's already on, just didn't include it.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
on your script above..
try putting on top line
Open in new window