Good morning symfoners,I've been looking for an answers to this but I'm afraid I couldn't find any.
Symfony routing usually works like this, adding modules and actions without a final slash in the url. /:module/:action /:module
Therefore, I could get to a simple routing just like this. /post/create /post
So far so good, until the final user decide to write a direct url in the browser with a final slash, just like this. /post/create/ /post/
If this happens they would get a plain 404 error, I do know about content repeating is banned from Google, but we could just use a simple 302 redirect to make this work hassle free.
/post/create/ would redirect to /post/create and the users could get to the action, as simple as that. Is it possible to make this work, if so how?
> Good morning symfoners, > I've been looking for an answers to this but I'm afraid I couldn't > find any.
> Symfony routing usually works like this, adding modules and actions > without a final slash in the url. > /:module/:action > /:module
> Therefore, I could get to a simple routing just like this. > /post/create > /post
> So far so good, until the final user decide to write a direct url in > the browser with a final slash, just like this. > /post/create/ > /post/
> If this happens they would get a plain 404 error, I do know about > content repeating is banned from Google, but we could just use a > simple 302 redirect to make this work hassle free.
> /post/create/ would redirect to /post/create and the users could get > to the action, as simple as that. > Is it possible to make this work, if so how?
> I just created a 2nd route with the / at the end, but you are probably > right this should be handled automatically by symfony.
> James
> On Jan 26, 2008, at 11:54 AM, Joan Piedra wrote:
> Good morning symfoners,I've been looking for an answers to this but I'm > afraid I couldn't find any.
> Symfony routing usually works like this, adding modules and actions > without a final slash in the url. > /:module/:action > /:module
> Therefore, I could get to a simple routing just like this. > /post/create > /post
> So far so good, until the final user decide to write a direct url in the > browser with a final slash, just like this. > /post/create/ > /post/
> If this happens they would get a plain 404 error, I do know about content > repeating is banned from Google, but we could just use a simple 302 redirect > to make this work hassle free.
> /post/create/ would redirect to /post/create and the users could get to > the action, as simple as that. > Is it possible to make this work, if so how?
> and it is work good for me both "/blog/lab/detail/stripped-title" > and "/blog/lab/detail/stripped-title/"
> 2008/1/26, James <thenet...@gmail.com <mailto:thenet...@gmail.com>>:
> I just created a 2nd route with the / at the end, but you are > probably right this should be handled automatically by symfony.
> James
> On Jan 26, 2008, at 11:54 AM, Joan Piedra wrote:
>> Good morning symfoners, >> I've been looking for an answers to this but I'm afraid I >> couldn't find any.
>> Symfony routing usually works like this, adding modules and >> actions without a final slash in the url. >> /:module/:action >> /:module
>> Therefore, I could get to a simple routing just like this. >> /post/create >> /post
>> So far so good, until the final user decide to write a direct url >> in the browser with a final slash, just like this. >> /post/create/ >> /post/
>> If this happens they would get a plain 404 error, I do know about >> content repeating is banned from Google, but we could just use a >> simple 302 redirect to make this work hassle free.
>> /post/create/ would redirect to /post/create and the users could >> get to the action, as simple as that. >> Is it possible to make this work, if so how?
> > and it is work good for me both "/blog/lab/detail/stripped-title" > > and "/blog/lab/detail/stripped-title/"
> > 2008/1/26, James <thenet...@gmail.com <mailto:thenet...@gmail.com>>:
> > I just created a 2nd route with the / at the end, but you are > > probably right this should be handled automatically by symfony.
> > James
> > On Jan 26, 2008, at 11:54 AM, Joan Piedra wrote:
> >> Good morning symfoners, > >> I've been looking for an answers to this but I'm afraid I > >> couldn't find any.
> >> Symfony routing usually works like this, adding modules and > >> actions without a final slash in the url. > >> /:module/:action > >> /:module
> >> Therefore, I could get to a simple routing just like this. > >> /post/create > >> /post
> >> So far so good, until the final user decide to write a direct url > >> in the browser with a final slash, just like this. > >> /post/create/ > >> /post/
> >> If this happens they would get a plain 404 error, I do know about > >> content repeating is banned from Google, but we could just use a > >> simple 302 redirect to make this work hassle free.
> >> /post/create/ would redirect to /post/create and the users could > >> get to the action, as simple as that. > >> Is it possible to make this work, if so how?
> > and it is work good for me both "/blog/lab/detail/stripped-title" > > and "/blog/lab/detail/stripped-title/"
> > 2008/1/26, James <thenet...@gmail.com <mailto:thenet...@gmail.com>>:
> > I just created a 2nd route with the / at the end, but you are > > probably right this should be handled automatically by symfony.
> > James
> > On Jan 26, 2008, at 11:54 AM, Joan Piedra wrote:
> >> Good morning symfoners, > >> I've been looking for an answers to this but I'm afraid I > >> couldn't find any.
> >> Symfony routing usually works like this, adding modules and > >> actions without a final slash in the url. > >> /:module/:action > >> /:module
> >> Therefore, I could get to a simple routing just like this. > >> /post/create > >> /post
> >> So far so good, until the final user decide to write a direct > url > >> in the browser with a final slash, just like this. > >> /post/create/ > >> /post/
> >> If this happens they would get a plain 404 error, I do know > about > >> content repeating is banned from Google, but we could just > use a > >> simple 302 redirect to make this work hassle free.
> >> /post/create/ would redirect to /post/create and the users > could > >> get to the action, as simple as that. > >> Is it possible to make this work, if so how?
James, phpleo a friend of mine blog about this topic with 2 code examples, a filter made by him and a modified htaccess for symfony. They both will make this work as expected.
> > > and it is work good for me both "/blog/lab/detail/stripped-title" > > > and "/blog/lab/detail/stripped-title/"
> > > 2008/1/26, James <thenet...@gmail.com <mailto:thenet...@gmail.com>>:
> > > I just created a 2nd route with the / at the end, but you are > > > probably right this should be handled automatically by symfony.
> > > James
> > > On Jan 26, 2008, at 11:54 AM, Joan Piedra wrote:
> > >> Good morning symfoners, > > >> I've been looking for an answers to this but I'm afraid I > > >> couldn't find any.
> > >> Symfony routing usually works like this, adding modules and > > >> actions without a final slash in the url. > > >> /:module/:action > > >> /:module
> > >> Therefore, I could get to a simple routing just like this. > > >> /post/create > > >> /post
> > >> So far so good, until the final user decide to write a direct url > > >> in the browser with a final slash, just like this. > > >> /post/create/ > > >> /post/
> > >> If this happens they would get a plain 404 error, I do know about > > >> content repeating is banned from Google, but we could just use a > > >> simple 302 redirect to make this work hassle free.
> > >> /post/create/ would redirect to /post/create and the users could > > >> get to the action, as simple as that. > > >> Is it possible to make this work, if so how?