Following a standard SharePoint install (WSS 3.0) you may receive the following error when carrying out a search:
The Web application at http://[URL to SharePoint]/ could not be found. Verify that you have typed the URL correctly. If the URL should be serving existing content, the system administrator may need to add a new request URL mapping to the intended application.
This is due to internal DNS mappings not being mirrored within SharePoint. That is, your DNS server may resolve http://sharepoint.local to 10.1.1.1, but SharePoint (or at least the search service) is only listening to requests on http://servername.local.
To add the CNAME within SharePoint, follow the instructions below:
This presumes you are configuring the search for internal searches – you can easily alter the instructions below for external mappings.
1. Login to the SharePoint server via RDP
2. Administrative Tools > SharePoint 3.0 Central Administration
3. Click ‘Operations’ in the left-hand menu pane
4. Click ‘Alternate access mappings’ under the ‘Global Configuration’ header
5. Click ‘Add Internal URLs’
6. Select ‘SharePoint – 80′ from within the ‘Alternate access mapping collection’ drop-down menu.
7. Type the full URL you require in the space provided. For example http://sharepoint.company.com
8. Select your required zone – for our example we select ‘Intranet’. Click Save which should then take you back to the mappings list.
SharePoint search should now work!