Apache 301自定义URL的rdirect

Apache 301自定义URL的rdirect,apache,.htaccess,redirect,Apache,.htaccess,Redirect,我有一个自定义的图片库网站,我转换成WordPress,这个网站有几千个这样的链接 http://www.example.net/Gallery?cmd=viewCarGallery&carID=13&pgID=1 http://www.example.net/Gallery?cmd=viewCarGallery&carID=9&pgID=1 Redirect 301 /Gallery?cmd=viewCarGallery&carID=9&pgID=1 http://www.example.ne

我有一个自定义的图片库网站,我转换成WordPress,这个网站有几千个这样的链接

http://www.example.net/Gallery?cmd=viewCarGallery&carID=13&pgID=1 http://www.example.net/Gallery?cmd=viewCarGallery&carID=9&pgID=1 Redirect 301 /Gallery?cmd=viewCarGallery&carID=9&pgID=1 http://www.example.net/gallery/gallery_ID http://www.example.net/Gallery?cmd=viewCarGallery&carID=13&pgID=1 http://www.example.net/Gallery?cmd=viewCarGallery&carID=9&pgID=1 所有链接现在都转换为wordpress,现在我面临重定向它们的问题,我尝试这样使用

http://www.example.net/Gallery?cmd=viewCarGallery&carID=13&pgID=1 http://www.example.net/Gallery?cmd=viewCarGallery&carID=9&pgID=1 Redirect 301 /Gallery?cmd=viewCarGallery&carID=9&pgID=1 http://www.example.net/gallery/gallery_ID 重定向301/Gallery?cmd=viewCarGallery&carID=9&pgID=1http://www.example.net/gallery/gallery_ID
请帮助我如何重定向这种URL

您的.htaccess文件中的永久301重定向让搜索引擎和其他人知道旧链接已被新链接替换。这是从现有页面引导流量的推荐方法。我在.htaccess文件中添加了以下代码


重定向301/oldfile.htm/newfile.htm

我想你需要的是修改重写。看看这里


这看起来像是一个类似的问题

不,这只是一个例子,目标URL是正常的wordpress post URL OK那么你能提供一些重定向前后URL的真实示例吗?