2011-08-05 149 views

回答

0

像這樣簡單:

Redirect 301 /seo/keywords-1-2-3/ /seo/mynew301page-1-2-3/ 

以上將重定向與/seo/keywords-1-2-3//seo/mynew301page-1-2-3/開頭的URL的所有請求。 例如:/seo/keywords-1-2-3/something?say=hello ==>/seo/mynew301page-1-2-3/something?say=hello

如果它必須是精確匹配(僅/seo/keywords-1-2-3/和不/seo/keywords-1-2-3/something,然後使用此之一:

RedirectMatch 301 ^/seo/keywords-1-2-3/$ /seo/mynew301page-1-2-3/ 

相同,但使用mod_rewrite

RewriteEngine On 

# broad (base) match 
RewriteRule ^/seo/keywords-1-2-3/(.*)$ /seo/mynew301page-1-2-3/$1 [R=301,L] 

# exact match 
RewriteRule ^/seo/keywords-1-2-3/$ /seo/mynew301page-1-2-3/ [R=301,L]