You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Josh Trutwin <jo...@trutwins.homeip.net> on 2009/04/08 18:19:05 UTC

[users@httpd] RewriteRule with .flv extension

I'm dealing with something odd and I can't figure out what to make of
it - I have the following rewrite rule:

RewriteRule
^([0-9]+)/([a-z0-9]+)/get_flash\.php$ /get_file.php?id=$1&flash=1&key=$2
[L]

then a URL liks this /123/2313412sdfsdf/get_flash.php works fine.

BUT if I change my rule to this (swapping .php for .flv):

RewriteRule
^([0-9]+)/([a-z0-9]+)/get_flash\.flv$ /get_file.php?id=$1&flash=1&key=$2
[L]

a URL like this: /123/2313412sdfsdf/get_flash.flv does NOT work. 

I turned on the rewrite log and for the .flv the URI it's checking is
always ''.  For .php it's 123/2313412sdfsdf/get_flash.php.  If I
clear the rewrite log and run the .flv URL/Rewrite 2313412sdfsdf is
not even in the rewrite log, but if I change to .php in Rewrite and
run the .php URL, 2313412sdfsdf is in the log - I don't get why a
simple extension change causes this.  "flv" is not in the apache conf
directory anywhere.

Any suggestions?  I'm stumped and need a .flv URL extension for a
dumb flash app to work.....

Apache 2.2.3-4+etch6

Thanks,

Josh

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] [SOLVED] RewriteRule with .flv extension

Posted by Josh Trutwin <jo...@trutwins.homeip.net>.
On Wed, 8 Apr 2009 12:31:34 -0400
Brian Mearns <me...@gmail.com> wrote:

> On Wed, Apr 8, 2009 at 12:19 PM, Josh Trutwin
> <jo...@trutwins.homeip.net> wrote:
> > I'm dealing with something odd and I can't figure out what to
> > make of it - I have the following rewrite rule:
> >
> > RewriteRule
> > ^([0-9]+)/([a-z0-9]+)/get_flash\.php$ /get_file.php?id=$1&flash=1&key=$2
> > [L]
> >
> > then a URL liks this /123/2313412sdfsdf/get_flash.php works fine.
> >
> > BUT if I change my rule to this (swapping .php for .flv):
> >
> > RewriteRule
> > ^([0-9]+)/([a-z0-9]+)/get_flash\.flv$ /get_file.php?id=$1&flash=1&key=$2
> > [L]
> >
> > a URL like this: /123/2313412sdfsdf/get_flash.flv does NOT work.
> >
> > I turned on the rewrite log and for the .flv the URI it's
> > checking is always ''.  For .php it's
> > 123/2313412sdfsdf/get_flash.php.  If I clear the rewrite log and
> > run the .flv URL/Rewrite 2313412sdfsdf is not even in the rewrite
> > log, but if I change to .php in Rewrite and run the .php URL,
> > 2313412sdfsdf is in the log - I don't get why a simple extension
> > change causes this.  "flv" is not in the apache conf directory
> > anywhere.
> >
> > Any suggestions?  I'm stumped and need a .flv URL extension for a
> > dumb flash app to work.....
> >
> > Apache 2.2.3-4+etch6
> >
> > Thanks,
> >
> > Josh
> 
> Define "does not work". Do you get a 404? If it's not a 404, but you
> just don't get the content you expect, it could be that apache is
> not passing it to PHP to be processed. Try a [PT] flag
> (pass-through) on the rewrite so the URL gets processed by the rest
> of the configuration (e.g., the content-handler is determined as
> normal).

Sorry, I guess by "does not work" I mean that it doesn't even match
the URL.  No change with PT.  If I watch the rewrite log (at debug
level 3) it doesn't even put the path in the URI it's trying to match
against.

I don't know why but I played around and changed the path around a
little and it worked.  :/

Josh


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] RewriteRule with .flv extension

Posted by Brian Mearns <me...@gmail.com>.
On Wed, Apr 8, 2009 at 12:19 PM, Josh Trutwin <jo...@trutwins.homeip.net> wrote:
> I'm dealing with something odd and I can't figure out what to make of
> it - I have the following rewrite rule:
>
> RewriteRule
> ^([0-9]+)/([a-z0-9]+)/get_flash\.php$ /get_file.php?id=$1&flash=1&key=$2
> [L]
>
> then a URL liks this /123/2313412sdfsdf/get_flash.php works fine.
>
> BUT if I change my rule to this (swapping .php for .flv):
>
> RewriteRule
> ^([0-9]+)/([a-z0-9]+)/get_flash\.flv$ /get_file.php?id=$1&flash=1&key=$2
> [L]
>
> a URL like this: /123/2313412sdfsdf/get_flash.flv does NOT work.
>
> I turned on the rewrite log and for the .flv the URI it's checking is
> always ''.  For .php it's 123/2313412sdfsdf/get_flash.php.  If I
> clear the rewrite log and run the .flv URL/Rewrite 2313412sdfsdf is
> not even in the rewrite log, but if I change to .php in Rewrite and
> run the .php URL, 2313412sdfsdf is in the log - I don't get why a
> simple extension change causes this.  "flv" is not in the apache conf
> directory anywhere.
>
> Any suggestions?  I'm stumped and need a .flv URL extension for a
> dumb flash app to work.....
>
> Apache 2.2.3-4+etch6
>
> Thanks,
>
> Josh

Define "does not work". Do you get a 404? If it's not a 404, but you
just don't get the content you expect, it could be that apache is not
passing it to PHP to be processed. Try a [PT] flag (pass-through) on
the rewrite so the URL gets processed by the rest of the configuration
(e.g., the content-handler is determined as normal).

-Brian

-- 
Feel free to contact me using PGP Encryption:
Key Id: 0x3AA70848
Available from: http://pgp.mit.edu/

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org