MOD_REWRITE on Apache 2.2 not working

I am trying to rewrite requests to image files to Rackspace CloudFiles CDN. I tried the following in .htaccess file but no luck

Options +FollowSymlinks
RewriteEngine on
RewriteRule ^/files/(.*)$ http://********.rackcdn.com/$1 [R=302,L]

********** = unique Container ID which is present in the actual .htaccess file.
j_pearcyAsked:
Who is Participating?
 
BigRatConnect With a Mentor Commented:
One either puts rewrite rules inside httpd.conf (which I always do so that for my sites I always can immediately see what is what) or in the directory in which the URL resolves to (which one always forgets that one has done that)
0
 
BigRatCommented:
>>********** = unique Container ID which is present in the actual .htaccess file.

That I don't understand? How present in the .htaccess file?

But notwithstanding, check that the .htaccess file is in the directory /files and this is directly under the directory sopecified in directory path and that the server has access to the .htaccess file.
(Usual things, I know, but often overlooked).
0
 
j_pearcyAuthor Commented:
So even though /files/ is specified the .htaccess file still needs to be inside /files/? I will try that.
0
 
BigRatCommented:
PS the bad news is that it is cheese time here in Europe, so I'm off home for dinner.
0
 
j_pearcyAuthor Commented:
You got me headed down the right track. I put the rewrite rule in the httpd.conf file and that led me to find out that my CDN config was wrong.

THANKS!
0
All Courses

From novice to tech pro — start learning today.