Solved

MOD_REWRITE on Apache 2.2 not working

Posted on 2011-03-01
5
372 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
ID: 35019646
>>********** = 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
ID: 35019685
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
ID: 35019706
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
ID: 35019715
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
ID: 35020011
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

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

As Wikipedia explains 'robots.txt' as -- the robot exclusion standard, also known as the Robots Exclusion Protocol or robots.txt protocol, is a convention to prevent cooperating web spiders and other web robots from accessing all or part of a websit…
Over the last year I have answered a couple of basic URL rewriting questions several times so I thought I might as well have a stab at: explaining the basics, providing a few useful links and consolidating some of the most common queries into a sing…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

786 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