1

I'm having a problem with Django urlconf.

Basically I've this pattern:

^publication/(?P<pub_search>[\w\.=&]+)?(/keyword/(?P<key_search>[\w=&]+))?(/author/(?P<auth_search>[\w=&]+))?(/tag/(?P<tag_search>[\w=&]+))?(/from/(?P<from_date>[\w\d=&]+))?(/until/(?P<until_date>[\w\d=&]+))?$

According this pattern, I should be able to have an URL of this form:

http://127.0.0.1:8000/publication//author/name=crock

Indeed this url form is recognized in my django dev server. But on the production server (Apache + mod_wsgi) it doesn't match the url.

I've no idea of the reason why it acts this way on prod server.

Cheers

renard
  • 1,368
  • 6
  • 20
  • 40

1 Answers1

1

Apache removes multiple slashes inside the path. You can fix this with some mod_rewrite magic.

Quoting from here:

RewriteCond %{THE_REQUEST} ^GET\ /(https?://[^\s]+)
RewriteRule ^https?:/ index.php?url=%1 [L]
Community
  • 1
  • 1
Wesley
  • 2,204
  • 15
  • 14
  • Thanks, but I'm quite noob with mod_rewrite... How should I write the rule to allow doubleslashes for all urls under http://www.example.com/ckp/ for instance ? – renard May 25 '12 at 14:13
  • I'm no expert on mod_rewrite either. I added an example but googling around should help you. Either way, I would see if you can get rid of the double slash in the url pattern.. – Wesley May 25 '12 at 14:17