문제

I updated a webforum which causes the old urls to be invalid. The old structure was:

www.myforum.com/index.php?page=Thread&threadID=34541/

the new structure has to be:

www.myforum.com/index.php/Thread/34541

Can you please provide me the .htaccess-rule for that?

도움이 되었습니까?

해결책

add the following rules to your .htaccess (in the root directory of your website)

RewriteCond %{QUERY_STRING} ^page=(.+?)&threadID=(\d+)/?$ [NC]
RewriteRule ^index\.php$ /index.php/%1/%2? [NC,R=301,L]

다른 팁

RewriteEngine On
RewriteCond %{QUERY_STRING}   ^page=Thread&threadID=(\d+)/?$
RewriteRule .*  index.php/Thread/%1   [L]

Please note that this rule redirects internally. for external redirect use R flag.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top