我正在开发一个名为www.centreauto.ca的域名,该域名将被重定向到www.autoevolution95.com。
我在centreauto.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上的网址重写不正确吗?
以下是他们的样本:
urlpatterns += patterns('',
url(r'^$', DKIObjectsView.as_view(
template_name="addon-sites/autoevolution95/main-site/pages/index.html",
relevance_json = silos_keywords_json)),
谢谢,
米甲
答案 0 :(得分:0)
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]