I am back for advice. I have a site that needs SEO help and have been asked to ad a 301 redirect. This site is a convertion to django from php I gather. Now I have been given a csv of about 700 URL’s all basically of
Well I decided after research that I needed to do a from django.views.generic.simple import redirect_to work around. But playing with this, it’s not working. Can any one help me with a pointer on what to use? I have read the docs here:
and here are my URL’s:
from django.conf.urls.defaults import patterns, include, url
from django.contrib import admin
from django.views.generic.simple import direct_to_template
from django.views.generic.simple import redirect_to
from main.sitemaps import sitemaps
from main.views import *
admin.autodiscover()
urlpatterns = patterns('',
# Redirects from old site
(r'^floor-plans/search/$', redirect_to, {'url': 'http://www.rhodeislandrow.com/floor-plans/'}),
url(r'^admin/', include(admin.site.urls)),
url(r'^subscribe/$', SubscribeView, name='subscribe'),
url(r'^vaultware-template/$', VaultwareTemplateView.as_view()),
url(r'^', include('stateful.urls')),
url(r'^', include('cms.urls')),
(r'^sitemap\.xml$', 'django.contrib.sitemaps.views.sitemap', {'sitemaps': sitemaps}),
(r'^robots.txt$', include('robots.urls')),
)
I figured it out. Because my URL’s are not ending in /search/ I needed to add the wildcard
Thanks for the responses and I will use the redirect app for future projects.