2014-12-02 1 views
-2

나는 즉, 나는 "http://www.example.com/showthread.php?t=1&page=2"원하는301 thread/1/page-2에 showthread.php? t = 1 & page = 2 리디렉션 하시겠습니까?

http://www.example.com/showthread.php?t=1&page=2http://www.example.com/threads/1/page-2

http://www.example.com/showthread.php?t=1 내가 "301 리디렉션은"이 "다시 쓰기"NOT 할 http://www.example.com/threads/1

에 다음과 같은 리디렉션 할 폴더 구조에 301 리디렉션에 연결하십시오.

상담해주십시오.

+0

당신이 시도 않은 문제가 발생할 어디에서 얻었 는가? – Novocaine

답변

0

당신은 사용할 수 있습니다

RewriteEngine on 
RewriteBase/

# external redirect from actual URL to pretty one 
RewriteCond %{THE_REQUEST} \s/+showthread\.php\?t=(\d+)&page=(\d+) [NC] 
RewriteRule^/threads/%1/page-%2? [R=301,L,NE] 
RewriteCond %{THE_REQUEST} \s/+showthread\.php\?t=(\d+) [NC] 
RewriteRule^/threads/%1? [R=301,L,NE] 

# not for file or directory 
RewriteCond %{REQUEST_FILENAME} -d [OR] 
RewriteCond %{REQUEST_FILENAME} -f 
RewriteRule^- [L] 

# internal forward from pretty URL to actual one 
RewriteRule ^threads/(\d+)/page-(\d+)/?$ /showthread.php?t=$1&page=$2 [L,NC] 
RewriteRule ^threads/(\d+)/?$ /showthread.php?t=$1 [L,NC]