[Catalyst] Changing a base url in mod_perl

Ovid curtis_ovid_poe at yahoo.com
Fri Dec 30 22:32:49 CET 2005


Hi all,

In my search controller, I have the following method defined:

  sub search : Regex( '^search/([[:alpha:]][[:word:]]*)(?:/(squery|slookup)(?:/(.*))?)?$') {
      ....
  }
 
That allows users to use URLs like the following:

  http://www.example.com/search/simple/squery/some/search/params

However, I need users to be able to dispatch to different base URLs:

  http://www.example.com/catalyst/search/simple/squery/some/search/params

I need the user at build time to be able to specify their own base url so I can do something like this:

  sub search : Regex("^$base_url/search/([[:alpha:]][[:word:]]*)(?:/(squery|slookup)(?:/(.*))?)?$") {
       ....
   }

I realize that syntax won't work, but I'm not sure how this is actually handled.

Cheers,
Ovid


--  If this message is a response to a question on a mailing list, please send follow up questions to the list.  Web Programming with Perl -- http://users.easystreet.com/ovid/cgi_course/



More information about the Catalyst mailing list