View Single Post

  #4 (permalink)  
Old 12-02-2006
HansH
 
Posts: n/a
Default Re: ReWrite Rule Question

"Brian Huether" <bhuetherNO@comcastSPAM.net> schreef in bericht
news:4ZadnThwlreBB-zYnZ2dnUVZ_oqdnZ2d@comcast.com...
>>> So the urls that are used are of the form
>>> audio.php?op=serveaudio&file=..audio/file.mp3
>>> I would like to use a ReWrite rule to do the following: A url of the
>>> form audiostuff/file.mp3 gets rewritten to
>>> audio.php?op=serveaudio&file=..audio/file.mp3
>>>

>> or within ./.htaccess
>> RewriteRule ^[^/]+/(.*\.mp3)$ audio.php?op=serveaudio&file=../audio/$1
>>

> audiostuff is actually a bogus directory

That's why I reluctantly -performance penalty- gave a rule for ./.htaccess
replacing the firts foldername by '../audio'
>
> the real directory is audio and it is at same level as public_html

From your previous post I assumed public_html to be your document root and
to have the same parent folder as audio. -Rather unsuprising given some
suggestions in your other thread about mp3-
Document root is then assummed -unsure though- to be the current working
directory for audio.php. Alltogether that's why the file parameter starts
.../audio.

Still I do think, though did not test,
RewriteRule ^[^/]+/(.*\.mp3)$
audio.php?op=serveaudio&file=%{DOCUMENT_ROOT}/../audio/$1
will handle a request like
/whatever/classic/mozart/5thsymphony.mp3
to stream
/audio/classic/mozart/5thsymphony.mp3


HansH