我将如何通过 .htaccess 文件重定向以下网址。我对这些特定网址的问题是它们包含特殊字符:
blog/%7Blink%7D
blog/page/2012/%7Blink%7D
blog/page/2013/%7Blink%7D
%7Blink7D%
?cID=225
.ht 访问:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^blog/%7Blink%7D?$ http://www.mywebsite.com/ [R=301,L]
RewriteRule ^blog/page/2012/%7Blink%7D?$ http://www.mywebsite.com/ [R=301,L]
RewriteRule ^blog/page/2013/%7Blink%7D?$ http://www.mywebsite.com/ [R=301,L]
RewriteRule ^%7Blink7D%?$ http://www.mywebsite.com/ [R=301,L]
RewriteRule ^?cID=225?$ http://www.mywebsite.com/ [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>