我需要301将.htaccess从具有文件夹结构的旧站点重定向到使用结束文件夹名称作为url参数的新页面。
像这样:http://example.com/artists/artist-name
到
http://example.com/search-works.php?searchArtist=artist-name
答案 0 :(得分:1)
两个选项:
RewriteRule ^artists/artist-name$ /search-works.php?searchArtist=artist-name [R=301,NC,L]
或
RewriteRule ^artists/(.*)$ /search-works.php?searchArtist=$1 [R=301,NC,L]