Rank: Member
Joined: 3/25/2014(UTC) Posts: 15 Location: Bedford, NH Thanks: 3 times
|
I'm looking to add a rewrite rule to address a url structure name change from /Products/Name to /Parts/Name Any suggestions would be appreciated. Thanks Old Link Example http://www.propartsdirec...-Mower-Blade__93005.aspxNew Link Example http://www.propartsdirec...-Mower-Blade__93005.aspx
|
|
|
|
Rank: Member
Joined: 3/25/2014(UTC) Posts: 15 Location: Bedford, NH Thanks: 3 times
|
Is there a way to do this globally for all links using this link structure /products/ /parts/
|
|
|
|
Rank: Administration
Joined: 4/2/2004(UTC) Posts: 2,393 Location: Hummelstown, PA Thanks: 6 times Was thanked: 163 time(s) in 158 post(s)
|
When you say "rewrite" do you actually mean "redirect"? |
Aaron Sherrick BV Commerce Toll-free 888-665-8637 - Int'l +1 717-220-0012 |
|
|
|
Rank: Member
Joined: 3/25/2014(UTC) Posts: 15 Location: Bedford, NH Thanks: 3 times
|
Yes, it would be great if there was a rewrite link structure that would take all cached links that have /products/ to /parts/ which is what the site is using now. Prob is there are over 3k links and we have been adding them one by one to the redirects file. Something more universal would be better. A month ago the link structure was updated and it doesn't look like BV auto wrote a rule to redirect all those broken links to new.
|
|
|
|
Rank: Administration
Joined: 4/2/2004(UTC) Posts: 2,393 Location: Hummelstown, PA Thanks: 6 times Was thanked: 163 time(s) in 158 post(s)
|
Originally Posted by: Scribbit YProb is there are over 3k links and we have been adding them one by one to the redirects file. Something more universal would be better. Unfortunately the redirector in 2013/2015 does not handle regular expressions in the redirect to URL (only the request URL); otherwise it could be simple. However, you should be able to easily create all of the redirects using the import/export tool. Follow these steps: - Export redirects (Content >> URL Redirects) -- this gives you the file format to use for an import.
- Export the entire product catalog.
- Open both exported files in Excel.
- In the redirects.txt remove all of the records (if there are any) leaving only the header row. Also remove the IsRegex and LastUpdated columns -- we don't need them for this.
- From the products.txt file copy the Bvin field into the SystemData field in the redirectst.txt file.
- From the products.txt file copy the RewriteUrl field into both the RedirectToUrl and RequestedUrl fields in the redirects.txt file.
- Now do a search/replace on the RequestedUrl to convert the new URL format to the old one (e.g. replace "/Products/" with "/Parts/").
- Set the StatusCode field to "301" (no quotes) for each record.
- Set the RedirectType field to "1" (no quotes) for each record -- this tells the redirector that this is a product redirect and it uses the bvin value in the SystemData field to match up the record to the product. This is used so that future changes to the product's URL will update existing redirects to the new URL.
- The Bvin field should be blank -- this is how the import knows to perform an insert rather than an update.
- Run the import!
Originally Posted by: Scribbit A month ago the link structure was updated and it doesn't look like BV auto wrote a rule to redirect all those broken links to new. It sounds like you're saying that someone changed the URL "prefix" for products (Options >> Site Settings >> Performance). In that case, no, URL redirects will not be auto-generated. |
Aaron Sherrick BV Commerce Toll-free 888-665-8637 - Int'l +1 717-220-0012 |
|
|
|
Rank: Member
Joined: 1/10/2005(UTC) Posts: 714
Thanks: 14 times Was thanked: 1 time(s) in 1 post(s)
|
Hey Aaron, I followed your instructions here for the url rewrite. I still can't get it to work. It keeps skipping over all of my rows. It also said IsRegex is required. I added that column but it still keeps skipping the rows. Nothing is showing up in the audit log either. Anything I am missing? Rows added/updated: 0 Rows unchanged: 0 Rows skipped: 293 Unable to save new redirect for "/ritter-203-treatment-table.aspx". Edited by user Thursday, December 29, 2016 12:16:46 PM(UTC)
| Reason: Not specified
|
|
|
|
Rank: Administration
Joined: 4/2/2004(UTC) Posts: 2,393 Location: Hummelstown, PA Thanks: 6 times Was thanked: 163 time(s) in 158 post(s)
|
Can you provide a sample import file? |
Aaron Sherrick BV Commerce Toll-free 888-665-8637 - Int'l +1 717-220-0012 |
|
|
|
Rank: Member
Joined: 1/10/2005(UTC) Posts: 714
Thanks: 14 times Was thanked: 1 time(s) in 1 post(s)
|
I think there may be a problem because these products had custom URLs. I did find a way around it, but attached is the import file. Edited by user Tuesday, January 3, 2017 2:15:56 PM(UTC)
| Reason: Not specified
|
|
|
|
Rank: Administration
Joined: 4/2/2004(UTC) Posts: 2,393 Location: Hummelstown, PA Thanks: 6 times Was thanked: 163 time(s) in 158 post(s)
|
The instructions that I posted assume that you have manually-specified URLs (i.e. the RewriteUrl field has a value). Perhaps that was an oversight on my part in Scribbit's posts above. None of the products in your export have a RewriteUrl value so that's why these instructions aren't working for you.
By the way, I removed your attachment above since it contained some sensitive data that you might not want people to see. |
Aaron Sherrick BV Commerce Toll-free 888-665-8637 - Int'l +1 717-220-0012 |
|
|
|
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.