Divya V
Divya V

Reputation: 11

When I change the HTML website to Django redirects app, I how do I do a 301 redirection automatically for diverting traffic from an old to a new link?

Django redirects app

I added this , in my installed app section in settings.py

'django.contrib.redirects',

MIDDLEWARE = [

'django.contrib.redirects.middleware.RedirectFallbackMiddleware',

]

I added the sites in the admin panel

domain name : http://127.0.0.1:8000/

I added redirects in the admin panel. old link : redirect from : /index/

& new link : redirect to: /index.html

I didn't mention this URL link in my urls.py like below

path('index.html/', views.index, name='index'),

I check the invalid URL as new URL.

I run the local server. its not working

Upvotes: 1

Views: 40

Answers (0)

Related Questions