Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4113386
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T22:19:04+00:00 2026-05-20T22:19:04+00:00

I would like to create a filter that runs before the routing system does

  • 0

I would like to create a filter that runs before the routing system
does and am wondering if this is possible.

Specifically, I would like to parse and redirect URLs myself in
certain situations using a filter. The urls that needed to be parsed
using my filter will otherwise fall through all the rules in my
routing.yml.

Currently what I’m doing is running the filter first in filters.yml,
but when I need to redirect in my filter a variety of bad things
happen:

  1. sfStopExceptions and sfError404Exceptions are thrown anyway and
    clutter up my logs (see this bug: http://trac.symfony-project.org/ticket/4741)
  2. I get a whole bunch of lines like this in my log:

[Mon Mar 07 14:24:48 2011] [error] [client 67.184.53.79] FastCGI:
server “/var/local/fcgi/php-cgi-wrapper.fcgi” stderr: Empty module and/
or action after parsing the URL “/files/beezee50.png” (/)., referer:
http://bee-zee-body-shop.blahblah.mobi/bee-zee-body-shop

[Mon Mar 07 14:24:53 2011] [error] [client 67.184.53.79] FastCGI:
server “/var/local/fcgi/php-cgi-wrapper.fcgi” stderr: Action
“beezeebodyshop/index” does not exist.

If I was able to redirect successfully before the routing was done,
none of this should happen.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T22:19:04+00:00Added an answer on May 20, 2026 at 10:19 pm

    I would subclass sfPatternRouting (which is the most common sfRouting instance configured in the application’s factories.yml file), to handle those special cases you need to address, and do the regular stuff otherwise.
    You can set up your new routing class like this in the factories.yml:

    all:
      routing:
        class: yourAdvancedRouting
        param:
          generate_shortest_url:            true
          extra_parameters_as_query_string: true
          any_other_param_you_need:         value
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to create a class that runs something (a runnable) at regular
I would like to create a custom action filter attribute that adds a value
I would like to create kind of a before filter which allows me to
I would like to create this shape using just css. I am pretty sure
I would like to create a c++ type that mimic the build-in type exactly.
I'm using django-filter to drill down and would like to create breadcrumbs for each
I'm trying to create a SVG filter that would create an Anaglyph effect. What
I would like to create some logic with in my Rails app that is
I'm trying to create a filter / tagging system. This answer works well but
I would like to create an appender that logs only for a particular level

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.