Re: How to add a trailing slash in URL?

65 views
Skip to first unread message

Leonel Câmara

unread,
May 5, 2015, 1:39:12 PM5/5/15
to web...@googlegroups.com
Why? This is a bad idea what about URLs that have vars?

Leonel Câmara

unread,
May 5, 2015, 3:06:40 PM5/5/15
to web...@googlegroups.com
What about stylesheets and other files?


No and it won't work. Because a / denotes a directory.

I guess you could do this using pattern based URL rewriting, I don't like it.

Willoughby

unread,
May 5, 2015, 3:46:35 PM5/5/15
to web...@googlegroups.com
Maybe if you explained what problem you're trying to fix.


On Tuesday, May 5, 2015 at 3:32:20 PM UTC-4, Francisco Costa wrote:
I'm not saying changing all the URL's, but if there was an argument on the URL()

Something like this: URL(trailing=True)

--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to a topic in the Google Groups "web2py-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/web2py/EGJJ6xC4-2w/unsubscribe.
To unsubscribe from this group and all its topics, send an email to web2py+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Willoughby

unread,
May 5, 2015, 4:36:14 PM5/5/15
to web...@googlegroups.com
Well then how about a nasty reg-ex in the web server?
Something like this for nginx:
rewrite ^([^\?#]*/)([^\?#\./]+)([\?#].*)?$ $1$2/$3 permanent;



On Tuesday, May 5, 2015 at 4:16:57 PM UTC-4, Francisco Costa wrote:
nothing to explain, I just want my URL's to finish with a trail (obviously excluding the ones with vars)
Reply all
Reply to author
Forward
Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted
0 new messages