2014-09-24 6 views

답변

0

는 여러 가지 방법이 있습니다 선호되고, 그것이 SEO 관점에서

www.site.com/purchase-item

되고 싶어 이 문제를 해결할 수 있습니다. 가장 쉬운 방법은 아마도 mod_rewrite 규칙을 사용하는 것입니다. 밑줄 모든 요청을 쉽게 처리 할 수있는 백엔드 (kohana)에 대한 강조로 돌아

  • 재 작성에게 대시 모든 요청을 돌진하는

    1. 리디렉션 : 당신은 당신이 재 작성 규칙을하고 싶은 모든 것을 할 수 있습니다.

    나는 이것을 테스트하지 않았지만 나는 일을해야한다고 생각 :

    # redirect all requests with underscore to dash (this will do three dashes at a time, hopefully results in only one redirect for the client) 
    RewriteCond %{REQUEST_URI} ([^_]*)_([^_]*) 
    RewriteCond %1-%3 ([^_]*)(_([^_]*))? 
    RewriteCond %1-%3 ([^_]*)(_([^_]*))? 
    RewriteCond %1-%3 ([^_]*)-*$ 
    RewriteRule .* %1 [L,R=301,QSA] 
    
    # rewrite all requests with dash back to underscore 
    RewriteCond %{REQUEST_URI} ([^-]*)-([^-]*) 
    RewriteCond %1_%3 ([^-]*)(-([^-]*))? 
    RewriteCond %1_%3 ([^-]*)(-([^-]*))? 
    RewriteCond %1_%3 ([^-]*)_*$ 
    RewriteRule .* %1 [L]