[英]What did I do wrong with my 301 redirects?
我正在域名www.centreauto.ca上工作,該域名已重定向到www.autoevolution95.com。
我在centerauto.ca的.htaccess文件中寫了一堆重寫規則:
# Use PHP5.4 as default
#AddHandler application/x-httpd-php54s .php
# For security reasons, Option followsymlinks cannot be overridden.
#Options +FollowSymlinks
Options +SymLinksIfOwnerMatch
# Prevent Directoy listing
Options -Indexes
# SEO URL Settings
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !^/[0-9]+\..+\.cpaneldcv$
RewriteCond %{REQUEST_URI} !^/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?$
RewriteRule ^([^?]*) action.php?route=$1 [L,QSA]
Redirect 301 / http://www.autoevolution95.com/
Redirect 301 /?lang=french http://www.autoevolution95.com/
Redirect 301 /?lang=english http://www.autoevolution95.com/?lang=en
Redirect 301 /index.php http://www.autoevolution95.com/
Redirect 301 /index.php?lang=french http://www.autoevolution95.com/
Redirect 301 /index.php?lang=english http://www.autoevolution95.com/?lang=en
Redirect 301 /car-sales http://www.autoevolution95.com/
Redirect 301 /car-sales?lang=french http://www.autoevolution95.com/
Redirect 301 /car-sales?lang=english http://www.autoevolution95.com/?lang=en
Redirect 301 /car-sales/carfax http://www.autoevolution95.com/
Redirect 301 /car-sales/carfax?lang=french http://www.autoevolution95.com/
Redirect 301 /car-sales/carfax?lang=english http://www.autoevolution95.com/?lang=en
Redirect 301 /car-sales/credit-application http://www.autoevolution95.com/
Redirect 301 /car-sales/credit-application?lang=french http://www.autoevolution95.com/
Redirect 301 /car-sales/credit-application?lang=english http://www.autoevolution95.com/?lang=en
Redirect 301 /car-sales/financing http://www.autoevolution95.com/
Redirect 301 /car-sales/financing?lang=french http://www.autoevolution95.com/
Redirect 301 /car-sales/financing?lang=english http://www.autoevolution95.com/?lang=en
Redirect 301 /car-sales/inspections http://www.autoevolution95.com/
Redirect 301 /car-sales/inspections?lang=french http://www.autoevolution95.com/
Redirect 301 /car-sales/inspections?lang=english http://www.autoevolution95.com/?lang=en
Redirect 301 /car-sales/warranties http://www.autoevolution95.com/
Redirect 301 /car-sales/warranties?lang=french http://www.autoevolution95.com/
Redirect 301 /car-sales/warranties?lang=english http://www.autoevolution95.com/?lang=en
Redirect 301 /car-sales/we-buy http://www.autoevolution95.com/
Redirect 301 /car-sales/we-buy?lang=french http://www.autoevolution95.com/
Redirect 301 /car-sales/we-buy?lang=english http://www.autoevolution95.com/?lang=en
Redirect 301 /car-sales/why-centre-auto http://www.autoevolution95.com/
Redirect 301 /car-sales/why-centre-auto?lang=french http://www.autoevolution95.com/
Redirect 301 /car-sales/why-centre-auto?lang=english http://www.autoevolution95.com/?lang=en
Redirect 301 /body-work http://www.autoevolution95.com/
Redirect 301 /body-work?lang=french http://www.autoevolution95.com/
Redirect 301 /body-work?lang=english http://www.autoevolution95.com/?lang=en
Redirect 301 /body-work/got-into-an-accident http://www.autoevolution95.com/
Redirect 301 /body-work/got-into-an-accident?lang=french http://www.autoevolution95.com/
Redirect 301 /body-work/got-into-an-accident?lang=english http://www.autoevolution95.com/?lang=en
Redirect 301 /body-work/insurance-claim http://www.autoevolution95.com/
Redirect 301 /body-work/insurance-claim?lang=french http://www.autoevolution95.com/
Redirect 301 /body-work/insurance-claim?lang=english http://www.autoevolution95.com/?lang=en
Redirect 301 /body-work/body-repair http://www.autoevolution95.com/
Redirect 301 /body-work/body-repair?lang=french http://www.autoevolution95.com/
Redirect 301 /body-work/body-repair?lang=english http://www.autoevolution95.com/?lang=en
Redirect 301 /body-work/guarantee http://www.autoevolution95.com/
Redirect 301 /body-work/guarantee?lang=french http://www.autoevolution95.com/
Redirect 301 /body-work/guarantee?lang=english http://www.autoevolution95.com/?lang=en
Redirect 301 /body-work/book-body-work-appointment http://www.autoevolution95.com/
Redirect 301 /body-work/book-body-work-appointment?lang=french http://www.autoevolution95.com/
Redirect 301 /body-work/book-body-work-appointment?lang=english http://www.autoevolution95.com/?lang=en
Redirect 301 /mechanics http://www.autoevolution95.com/
Redirect 301 /mechanics?lang=french http://www.autoevolution95.com/
Redirect 301 /mechanics?lang=english http://www.autoevolution95.com/?lang=en
Redirect 301 /mechanics/auto-repair http://www.autoevolution95.com/
Redirect 301 /mechanics/auto-repair?lang=french http://www.autoevolution95.com/
Redirect 301 /mechanics/auto-repair?lang=english http://www.autoevolution95.com/?lang=en
Redirect 301 /mechanics/maintenance http://www.autoevolution95.com/
Redirect 301 /mechanics/maintenance?lang=french http://www.autoevolution95.com/
Redirect 301 /mechanics/maintenance?lang=english http://www.autoevolution95.com/?lang=en
Redirect 301 /mechanics/book-mechanical-repair-appointment http://www.autoevolution95.com/
Redirect 301 /mechanics/book-mechanical-repair-appointment?lang=french http://www.autoevolution95.com/
Redirect 301 /mechanics/book-mechanical-repair-appointment?lang=english http://www.autoevolution95.com/?lang=en
Redirect 301 /company/promotions http://www.autoevolution95.com/
Redirect 301 /company/promotions?lang=french http://www.autoevolution95.com/
Redirect 301 /company/promotions?lang=english http://www.autoevolution95.com/?lang=en
Redirect 301 /company http://www.autoevolution95.com/
Redirect 301 /company?lang=french http://www.autoevolution95.com/
Redirect 301 /company?lang=english http://www.autoevolution95.com/?lang=en
Redirect 301 /company/contact-us http://www.autoevolution95.com/
Redirect 301 /company/contact-us?lang=french http://www.autoevolution95.com/
Redirect 301 /company/contact-us?lang=english http://www.autoevolution95.com/?lang=en
Redirect 301 /got-into-an-accident http://www.autoevolution95.com/
Redirect 301 /got-into-an-accident?lang=french http://www.autoevolution95.com/
Redirect 301 /got-into-an-accident?lang=english http://www.autoevolution95.com/?lang=en
Redirect 301 /insurance-claim http://www.autoevolution95.com/
Redirect 301 /insurance-claim?lang=french http://www.autoevolution95.com/
Redirect 301 /insurance-claim?lang=english http://www.autoevolution95.com/?lang=en
Redirect 301 /body-repair http://www.autoevolution95.com/
Redirect 301 /body-repair?lang=french http://www.autoevolution95.com/
Redirect 301 /body-repair?lang=english http://www.autoevolution95.com/?lang=en
Redirect 301 /guarantee http://www.autoevolution95.com/
Redirect 301 /guarantee?lang=french http://www.autoevolution95.com/
Redirect 301 /guarantee?lang=english http://www.autoevolution95.com/?lang=en
Redirect 301 /brochures/garanties-supplementaires-vehicules-automobiles.pdf http://www.autoevolution95.com/
Redirect 301 /brochures/garanties-supplementaires-vehicules-automobiles_en.pdf http://www.autoevolution95.com/?lang=en
Redirect 301 /sitemap http://www.autoevolution95.com/sitemap.xml
Redirect 301 /sitemap?lang=french http://www.autoevolution95.com/sitemap.xml
Redirect 301 /sitemap?lang=english http://www.autoevolution95.com/sitemap.xml
但是,如果您現在導航到應該正確重定向的頁面之一,則它們會錯誤地重定向到錯誤的路徑,即:
http://www.centreauto.ca/car-sales?lang=english
不會重定向到:
http://www.autoevolution95.com/?lang=en
關於做錯了什么的建議? 可能是autoevolution95.com上的URL重寫不正確嗎?
以下是其中的一個示例:
urlpatterns += patterns('',
url(r'^$', DKIObjectsView.as_view(
template_name="addon-sites/autoevolution95/main-site/pages/index.html",
relevance_json = silos_keywords_json)),
謝謝,
米哈爾
.htaccess文件中的301
重定向是原義的。
Redirect 301 /insurance-claim http://www.autoevolution95.com/
表示將/insurance-claim
重定向到http://www.autoevolution95.com/
因此,如果您想重定向到新域中的相同URL,則必須在重定向規則中添加它:
Redirect 301 /insurance-claim http://www.autoevolution95.com/insurance-claim
更好的解決方案可能是提出一個重寫規則,該規則將所有內容從舊域重定向到新域。
RewriteEngine On
RewriteBase /
RewriteRule ^(.*)$ http://autoevolution95.com/$1 [R=301,L]
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.