Using dots on the URL. [routes.py] or [nginx]

142 views
Skip to first unread message

Albert Abril

unread,
Oct 24, 2013, 11:07:28 AM10/24/13
to web...@googlegroups.com
Hi everyone,

I'm missing some concepts with URLs, so, I don't know exactly the way I need to resolve this problem.

I have this scenario:
- nginx
- web2py

On my web2py application, I have two users: albert and albert.abril

First URL is working ok, second not:
1. http://localhost/profile/albert

My questions are:
- Is it permitted to use dots on the URL in last segments? Or should I rewrite to a underscore character or something?
- If it's permitted: should I manage it on nginx conf, or in web2py routes.py?

Thanks in advance.



Albert Abril

unread,
Oct 24, 2013, 11:44:57 AM10/24/13
to web...@googlegroups.com
Mm.. nginx with uwgsi looks like is receiving it allright:

[pid: 924|app: 0|req: 1542/3269] 95.21.110.xxx () {46 vars in 1179 bytes} [Thu Oct 24 15:35:01 2013] GET /profile/albert.abril => generated 50 bytes in 0 msecs (HTTP/1.1 400)3 headers in 116 bytes (1 switches on core 0)

So I guess I should hack into the routes.py.

And I guess I should make a regexp to $profile to the next line in routes.py:('/profile/$profile', '/app/profile/index/$profile'),



Albert Abril

unread,
Oct 25, 2013, 11:28:53 AM10/25/13
to web...@googlegroups.com
I think I need to include here:

    (r'.*?:https?://subdomain.domain.com:\w* /$anything', r'myapp'),

It should be appended after the 'w', I tried with this options, but no success: 

1.   (r'.*?:https?://subdomain.domain.com:\w.* /$anything'r'myapp'),

2.   (r'.*?:https?://subdomain.domain.com:\w\.* /$anything'r'myapp'),

3.   (r'.*?:https?://subdomain.domain.com:\w\\.* /$anything'r'myapp'),



Albert Abril

unread,
Oct 25, 2013, 1:20:31 PM10/25/13
to web...@googlegroups.com
neither for:

    (r'.*?:https?://subdomain.domain.com:[\w\.]+ /$anything', r'style'),

output:

First URL is working ok, second not:

Jonathan Lundell

unread,
Oct 25, 2013, 9:05:37 PM10/25/13
to web2py
On 25 Oct 2013, at 10:20 AM, Albert Abril <albert...@gmail.com> wrote:

neither for:

    (r'.*?:https?://subdomain.domain.com:[\w\.]+ /$anything', r'style'),

output:

First URL is working ok, second not:
1. http://subdomain.domain.com/profile/albert          Works
2. http://subdomain.domain.com/profile/albert.abril   Invalid request

By "works" do you mean redirects to style?
Reply all
Reply to author
Forward
0 new messages