Symfony 1.4 require a domain name in routing
        Posted  
        
            by 
                Sunjalo
            
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by Sunjalo
        
        
        
        Published on 2012-10-16T10:52:56Z
        Indexed on 
            2012/10/16
            11:00 UTC
        
        
        Read the original article
        Hit count: 438
        
I need to require a domain name in my symfony routing, my route looks like the following:
domain_example:
url: /routing/example/:domain_name
param: { module: myModule, action: index, sf_format: json }
requirements: { domain_name: '/^[a-z0-9]+([\-\.]{1}[a-z0-9]+)*\.[a-z]{2,5}$/' }
I have also tried:
requirements: { domain_name: '[/^[a-z0-9]+([\-\.]{1}[a-z0-9]+)*\.[a-z]{2,5}$/]' }
If I call my route like so: mydomain.com/routing/example/otherdomain.com - I just get the module/action does not exist exception.
Any advice appreciated - thanks everyone ^_^
© Stack Overflow or respective owner