Solved

MOD_REWRITE on Apache 2.2 not working

Posted on 2011-03-01
5
369 Views
Last Modified: 2012-05-11
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.
0
Comment
Question by:j_pearcy
  • 3
  • 2
5 Comments
 
LVL 27

Expert Comment

by:BigRat
Comment Utility
>>********** = 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
 

Author Comment

by:j_pearcy
Comment Utility
So even though /files/ is specified the .htaccess file still needs to be inside /files/? I will try that.
0
 
LVL 27

Accepted Solution

by:
BigRat earned 500 total points
Comment Utility
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
 
LVL 27

Expert Comment

by:BigRat
Comment Utility
PS the bad news is that it is cheese time here in Europe, so I'm off home for dinner.
0
 

Author Closing Comment

by:j_pearcy
Comment Utility
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

Featured Post

Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Join & Write a Comment

If you are running a LAMP infrastructure, this little code snippet is very helpful if you are serving lots of HTML, JavaScript and CSS-related information. The mod_deflate module, which is part of the Apache 2.2 application, provides the DEFLATE…
It is possible to boost certain documents at query time in Solr. Query time boosting can be a powerful resource for finding the most relevant and "best" content. Of course the more information you index, the more fields you will be able to use for y…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now