Skip to main content
Trans Am

Todd Klindt's SharePoint Admin Blog

Go Search
Home
Blog
Netcast homepage
SharePoint Terminology Wiki
  

Todd Klindt's home page > Todd Klindt's SharePoint Admin Blog > Posts > AAM bug makes external links internal
AAM bug makes external links internal

Every year my friends and family pester me for a list of gifts I would like. A couple of years ago, being the SharePoint nerd I am I created an online Christmas list for them on WSS v2. I had a picture of the item I wanted with a short description, an approximate price and a link to buy it from an online retailer. Very considerate of me, I know. I upgraded my site to WSS v3 after last Christmas some time. Well, the most wonderful time of the year came around again and with it came more requests from people wanting to shower me with gifts. I went to my trusty list and started uploading pictures and URLs. I was surprised to see that my links to www.amazon.com and www.bestbuy.com were being replaced with links to MY server. For instance, if some generous soul wanted to buy me a copy of Smokey and the Bandit in glorious HD DVD the URL to buy it from Amazon would be http://www.amazon.com/gp/product/B000NVL1Y0/ref=s9_asin_image_1?pf_rd_m=ATVPDKIKX0DER&pf_rd_s=center-5&pf_rd_r=0Z371DHGV5B58Q17QZAA&pf_rd_t=101&pf_rd_p=278842001&pf_rd_i=507846 . When I put that URL into my list it got magically changed to http://www.klindt.org/gp/product/B000NVL1Y0/ref=s9_asin_image_1?pf_rd_m=ATVPDKIKX0DER&pf_rd_s=center-5&pf_rd_r=0Z371DHGV5B58Q17QZAA&pf_rd_t=101&pf_rd_p=278842001&pf_rd_i=507846 when I viewed the page. Same relative URL but my server name instead of Amazon's. How could this be? Sure enough, every single URL I added did this whether it was from http://www.amazon.com , http://www.bestbuy.com or http://www.victoriassecret.com. I tried a few things and no matter what the list or where it was on my server, if I pasted in a URL it was changed to my server name from the original. I bounced the problem off of some of my MVP buddies and Rob Bogue suggested it might have something to do with Alternate Access Mappings (AAMs) and I should look there. For that site there were three AAMs, it looked like this:

http://www.klindt.org is the URL my friends and family use when they want to see what to buy me. Matrix is the name of the server itself and http://www was for me to use as shorthand internally. I removed http://matrix and http://www and made http://www.klindt.org the default. I checked existing URLs, they still pointed to http://www.klindt.org. I added a new one though and the Amazon URL stuck! Thank Rob! At that point I suspected I knew what the problem was, so I added http://matrix and checked it, still worked. To confirm my suspicion I added http://www and as I suspected the problem came back. When you add a URL to SharePoint it does a check to see if the URL is a link to itself, or a Base URL. If so, it saves the URL as a relative URL and when it renders it back to users it fills the server name in with the URL they used to hit the site so that the link is good. SharePoint was erroneously seeing http://www.amazon.com/ links as a base URL because it partially matched one of the AAMs, http://www. I removed http://www completely and changed one of the http://www.amazon.com links to http://matrix.amazon.com just to verify it wasn't just www. It wasn't. The http://matrix.amazon.com links were saved as Base URLs as well. I took it one step further and tried http://matrix2.amazon.com to see if it would match too, it didn't. The bug only seems to happen if the first part of the URL matches an AAM exactly.

Now that I understood the problem the fix was very easy, no more http://www AAMs on my server. I'll just have to keep an eye out to make sure my internal server names don't match any external ones the MSDN2 of http://msdn2.microsoft.com for instance.

The moral of the story is that if you have any problems with SharePoint rewriting your external URLs, verify they don't match up with an AAM.

tk

Comments

There are no comments yet for this post.
Items on this list require content approval. Your submission will not appear in public views until approved by someone with proper rights. More information on content approval.

Title


Body *


Today's date *

Please enter today's date so I know you are a real person
Attachments