2014-06-18 3 views
0

OpenCart 1.5.6을 사용하고 있으며 최근에 내 저장소를 하위 도메인에서 주 도메인으로 옮겼습니다. 이제는 기존 정적 카테고리 페이지 중 일부를 실제 공개 카테고리 카테고리/제품 페이지로 리디렉션하려고합니다. 여기 opencart에서 301 리디렉션

내 htaccess로 줄입니다 :

Redirect 301 /old-category.html http://www.mydomain.com/my-new-category 

이 규칙은 내 URL을 대부분 잘 작동하지만 그들 중 일부는 나를 취

http://www.mydomain.com/my-new-category?route=old-category.html

어떤 사람들은에게 제안 대신에 RewriteRule을 사용하거나 끝에 물음표를 추가하십시오.

RewriteRule ^sitemap.xml$ index.php?route=feed/google_sitemap [L] 
RewriteRule ^googlebase.xml$ index.php?route=feed/google_base [L] 
RewriteRule ^download/(.*) /index.php?route=error/not_found [L] 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteCond %{REQUEST_URI} !.*\.(ico|gif|jpg|jpeg|png|js|css) 
RewriteRule ^([^?]*) index.php?_route_=$1 [L,QSA] 

사람이 어떤 생각을 가지고 :

은 또한 다음과 같은 블록 전후 내 규칙을 퍼팅 시도?

답변

1

이 작동합니다 :

RewriteEngine On 

RewriteRule ^old-category\.html$ http://www.mydomain.com/my-new-category [L,NC,R=301] 

RewriteRule ^sitemap.xml$ index.php?route=feed/google_sitemap [L] 
RewriteRule ^googlebase.xml$ index.php?route=feed/google_base [L] 
RewriteRule ^download/(.*) /index.php?route=error/not_found [L] 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteCond %{REQUEST_URI} !.*\.(ico|gif|jpg|jpeg|png|js|css) 
RewriteRule ^(.+)$ index.php?_route_=$1 [L,QSA] 

301 캐싱 문제를 방지하기 위해 새로운 브라우저에서 테스트해야합니다.

+0

가 대단히 감사합니다 페이지 존재, 일 매력처럼 : D는 정확히 무엇이 잘못되었는지 물어볼 수 있습니까? – Tohid

+0

반갑습니다. 301 규칙은 다른 규칙 앞에 와야하고 브라우저에서 오래된 301 캐시를 피하려면 브라우저를 다시 시작 (또는 캐시 지우기)해야합니다. – anubhava

-1

이전 사이트의 대부분 카테고리/제품 페이지에서 301 리디렉션 문제가 있습니다. 예를 들어

내가 301 새 페이지

/dekorativnye-plenki/derevo 

로 된 페이지

/shop/dekorativnye-plenki/ category/29-derevo?route= product/category&path=25_29 

에서 리디렉션했지만 단절이 아닌 저를 리디렉션

/dekorativnye-plenki/derevo?_ route_=shop%2Fdekorativnye- plenki%2Fcategory%2F29-derevo 
+1

당신은 자신의 스레드를 게시해야합니다. 여기에 코멘트가 아닙니다. –