title: How handle or convert // to / in url address in python django and apache -- linux
body: <p>At first, thank you for reading :X</p>
  <h1>Problem + Description:</h1>
  <p>I'm redirecting http traffic from any ip address on port 80 to 10.0.0.1:8080 (django) via linux apache and iptables.</p>
  <p>When web user issue a request to this url (hello.gggstatic.com/generate_204******), I  handle path to <code>**generate_204**</code> url address, via this rule: <code>re_path('.*generate_204.*', lambda r: HttpResponseRedirect('splash/')),</code>.</p>
  <pre><code> Buuuuut, users are seeing `//splash/` instead of `/splash/` in browser.
  `http://10.0.0.1:8080//splash/`  #django 404 not found
   users must see:    
  `http://10.0.0.1:8080/splash/`   #django can handle it and via &quot;include('splash.urls')&quot;
  </code></pre>
  <p><strong>Problem:</strong> How to manage/remove/handle &quot;//&quot; in url address bar !!??</p>
  <p><strong>Log:</strong></p>
  <pre><code>[09/May/2020 13:43:36] &quot;GET //generate_204 HTTP/1.1&quot; 302 0
  Not Found: //splash/
  [09/May/2020 13:43:36] &quot;GET //splash/ HTTP/1.1&quot; 404 2328
  </code></pre>
  <p>my urls.py file in django-project:</p>
  <pre><code>urlpatterns = [
      re_path('/static/', serve,{'document_root': settings.STATICFILES_DIRS}), 
      re_path('.*generate_204.*', lambda r: HttpResponseRedirect('splash/')),
      path('', lambda r: HttpResponseRedirect('splash/')),
      #path('admin/', admin.site.urls),
      path('splash/', include('splash.urls')),
  ]
  </code></pre>
  <p>my urls.py file in django-application:</p>
  <pre><code>urlpatterns = [
      re_path('^$', views.start, name='start'),
      re_path('index/$', views.start, name='start'),
      path('validation', views.validation, name='validation'),
      path('bye', views.goodbye, name='goodbye'),
  ]
  </code></pre>
  <p><strong>I edited my question:</strong></p>
  <pre><code>path('splash/', include('splash.urls')),
  #above line failed to handle //splash behavior.
  to:
  re_path('.*splash/', include('splash.urls')),  
  #above line works. but it's not ok. and we can have everything here between ip/domin:8080 and /splash: http://10.0.0.1/******/splash/. and this behavior is bad for url handling.
  </code></pre>