views:

79

answers:

3

Hi,

How do I write a rewrite rule for the following condition.

  1. I have my directory setup as /root/projectname/trunk/www/

I've setup site.local in hosts file to point to /root/

  1. How do I make this request http://site.local/projectname to grab data from /root/project_name/trunk/www/ instead of from /root/projectname/ ?

Right now I have it as RewriteRule ^projectname/*$ projectname/trunk/www/ [L] That works for just http://site.local/projectname, but others like http://site.local/projectname/images/image1.jpg doesn't work.

Please enlight.

Thank you, Tee

+1  A: 

I think you should write you rule like following

RewriteRule ^projectname/(*)$ projectname/trunk/www/$1 [L]

but not tested

RageZ
A: 

Hi RageZ, thanks for the reply.

I tried that and it's giving me a 500 error message now.

[Thu Sep 24 21:13:43 2009] [error] [client 127.0.0.1] Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace.

Any clue why it's behaving like that?

Thank you, Tee

teepusink
A: 

Ah I figured out what's cracking. Since the mapping and mapped path both contains projectname, it just keeps on rewriting. So I got to change the name to something else and it works.

Thanks, Tee

teepusink