Requests to "www.domain" when routing is just "domain" causes every future request to be 404

11 views
Skip to first unread message

Michael Boyd

unread,
Oct 27, 2010, 7:27:15 AM10/27/10
to play-framework
I submitted a description of the bug here:
http://play.lighthouseapp.com/projects/57987-play-framework/tickets/344-requests-to-wwwdomain-when-routing-is-just-domain-causes-every-future-request-to-be-404

Does anyone know a solution to the "www." problem until the bug is
fixed? I had a try at fixing it but there is no error message :(

Nicolas Leroux

unread,
Oct 27, 2010, 7:31:11 AM10/27/10
to play-fr...@googlegroups.com
Can you try to change your route to GET .*isitworthseeing.com${ext}/ MovieReviews.index ?
Note sure it will work but it should

Nicolas
--
You received this message because you are subscribed to the Google Groups "play-framework" group.
To post to this group, send email to play-fr...@googlegroups.com.
To unsubscribe from this group, send email to play-framewor...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/play-framework?hl=en.


Nicolas Leroux

unread,
Oct 27, 2010, 7:31:48 AM10/27/10
to play-fr...@googlegroups.com
Sorry to GET .*isitworthseeing.com/${ext}/ MovieReviews.index 

Nicolas
On Oct 27, 2010, at 1:27 PM, Michael Boyd wrote:

Michael Boyd

unread,
Oct 27, 2010, 7:40:52 AM10/27/10
to play-fr...@googlegroups.com
.*domain.com doesn't work, but [a-z.]+domain.com and (www.?)domain.com do. The (www.?) one broke when I tried the sub-domain "asd" though. I'll use [a-z.]+domain.com for now. Thanks!

Michael Boyd

unread,
Oct 27, 2010, 7:46:51 AM10/27/10
to play-fr...@googlegroups.com
[a-z.]+ should have an *, not +.

I also added a route to redirect all www requests to the non-www domain:

*       www.[a-z.]+/.*                                                  SharedPages.removeWWW

    public static void removeWWW()
    {
        redirect(request.getBase().replace("www.", "") + request.url);
    }

Thanks again.
Reply all
Reply to author
Forward
0 new messages