Ian,

Does this work?

news_asset:
  url: /news/asset/:news_id/:filename
  param: { module: news, action: viewasset }
  requirements: { news_id: \d, filename: .* }


What version of symfony? This is possible with the routing system in the
routing branch. As long as apache is sending the request, it should work.
Otherwise, wait for 1.1 where Francois built multiformats in to symfony.

Cheers,

Dustin


On 7/5/07 6:50 AM, "Ian P. Christian" <[EMAIL PROTECTED]> wrote:

> I'm trying to allow files of any extention to be re-written though
> symfony, for example:
> 
> /news/asset/3122/filename.gif
> and
> /news/asset/3122/filename.png
> 
> should match this route:
> 
> news_asset:
>   url: /news/asset/:news_id/:filename
>   param: { module: news, action: viewasset }
> 
> However, I use .html as a default file extension, and these files aren't
> matching the routing rule.
> 
> I thought I'd use mod_rewrite to fix this problem, and used the
> following rule:
> 
> RewriteCond %{REQUEST_URI} news/asset
> RewriteCond %{REQUEST_URI} !\.html$
> RewriteRule ^(.*)$ $1.html [L]
> 
> This kinda works, it rewrites the URL and  _SERVER[REDIRECT_URL] now
> contains a correctly re-written URL, for example, this can be seen in
> the debug toolbar:
> 
>   REDIRECT_URL: /news/asset/3122/banner3.gif.html
> 
> However, sfRequeset doesn't look at the REDIRECT_URL, and only at
> REQUEST_URI,  so this doesn't work.
> 
> Does anyone have any suggestions on how to work around these problems?
> 



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"symfony users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to