Redirect to New URLs
3 posts
• Page 1 of 1
- [email protected]
- Posts: 6
- Joined: 29 Jan 2014, 00:50
Redirect to New URLs
For a couple years we've been using mapping files to redirect our product pages to SEO friendly URLs. Below is a rule used.
# Product Rewrites
RewriteCond %{QUERY_STRING} ^productID=(.+)$ [NC]
RewriteCond ${productmap:%1|NOT_FOUND} !NOT_FOUND
RewriteRule ^productinfo\.aspx$ ${productmap:%1}? [NC,R=301,L]
We now have a new SEO consultant that says all our URLs need to change. I need some expert advice on how best to approach this since all the search engines have us indexed with the existing friendly URLs.
Example of how our mapping works today:
http://www.mysite.com/productinfo.aspx?productID=A121 is redirects to http://www.mysite.com/gift-baskets/baby-gifts/baby-boy
Example of what the SEO wants the change to be:
http://www.mysite.com/productinfo.aspx?productID=A121 is redirected to http://www.mysite.com/baby-boy-A121
How do I map to http://www.mysite.com/baby-boy-A121 and also permanently 301 redirect all the old URLs to the newly suggested ones.
Any help would be appreciated.
Thanks
tina
# Product Rewrites
RewriteCond %{QUERY_STRING} ^productID=(.+)$ [NC]
RewriteCond ${productmap:%1|NOT_FOUND} !NOT_FOUND
RewriteRule ^productinfo\.aspx$ ${productmap:%1}? [NC,R=301,L]
We now have a new SEO consultant that says all our URLs need to change. I need some expert advice on how best to approach this since all the search engines have us indexed with the existing friendly URLs.
Example of how our mapping works today:
http://www.mysite.com/productinfo.aspx?productID=A121 is redirects to http://www.mysite.com/gift-baskets/baby-gifts/baby-boy
Example of what the SEO wants the change to be:
http://www.mysite.com/productinfo.aspx?productID=A121 is redirected to http://www.mysite.com/baby-boy-A121
How do I map to http://www.mysite.com/baby-boy-A121 and also permanently 301 redirect all the old URLs to the newly suggested ones.
Any help would be appreciated.
Thanks
tina
- HeliconAndrew
- Posts: 1264
- Joined: 07 Mar 2012, 10:16
Re: Redirect to New URLs
Hello,
If I were you, I'd swap the existing productmap file for a new one with new landing SEO-friendly URL. Secondly, to fix the existing URLs like "gift-baskets/baby-gifts/baby-boy", I'd create a new rule like:
In a newmapfile you'd place the OLD SEO links to the left and NEW SEO links to the right.
Regards
If I were you, I'd swap the existing productmap file for a new one with new landing SEO-friendly URL. Secondly, to fix the existing URLs like "gift-baskets/baby-gifts/baby-boy", I'd create a new rule like:
- Code: Select all
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond ${mapfile:$1|NOT_FOUND} !NOT_FOUND
RewriteRule (.*) ${newmapfile:$1}? [NC,R=301,L]
In a newmapfile you'd place the OLD SEO links to the left and NEW SEO links to the right.
Regards
- [email protected]
- Posts: 6
- Joined: 29 Jan 2014, 00:50
Re: Redirect to New URLs
I appreciate the help. Put it in place tonight with no issues.
3 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 0 guests