我回来征求意见。我有一个需要 SEO 帮助的网站,并被要求投放 301 重定向广告。这个站点是我收集的从 php 到 django 的转换。现在我得到了一个大约 700 个 URL 的 csv,基本上都是
好吧,我在研究后决定我需要做一个 from django.views.generic.simple import redirect_来解决。但是玩这个,它不起作用。任何人都可以帮助我指导使用什么吗?我在这里阅读了文档:
这是我的网址:
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')),
)