0

I try to make django not append a trailing slash to my urls

I have set

APPEND_SLASH = False

in my settings.py

now there is my urlpatterns :

url(r'^foo.html$', 'SensorMonitoring.views.foo'),
url(r'^home.html$', 'SensorMonitoring.views.foo'),

I'm running that on a lighttpd server, when I call 127.0.0.1/foo.html no trailing slash is appended, but when I call 127.0.0.1/home.html it redirects me on 127.0.0.1/home.html/ and I don't want that because the CSS doesn't load if the urd end with a slash

I really don't understand why I have this behaviour only with home.html… I've try with many other urls and they work all

I use django 1.4

Quentin
  • 1,085
  • 1
  • 11
  • 29
  • Just a guess, but is the browser cache causing it, rather than the server? –  Feb 19 '13 at 17:31

1 Answers1

0

Try:

from django.http import HttpResponseRedirect

url(r'^foo.html$', 'SensorMonitoring.views.foo'),

url(r'^foo.html/$', lambda x: HttpResponseRedirect('/foo.html')),