Error with staging and production URL generation
Hello telerik, in order to enhance the security of our website and adhere to company Information Security rules, we have set two Sitefinity 4.1 projects for our website:
intranet:8011/.../
- staging server, used to edit the prod website
http://company.com/Sitefinity/
- prod server, for public viewing, this URL is not accessible, a URL redirect was set.
Both projects connect to a single database to ensure data is exactly the same.
Now the problem sets in, for Pagination links, Search result links and some other link URL's generated by the widgets in prod, the port number (in our case 8011) is being hailed when in fact the port number was used only in the staging server version of the site?
What could be the problem.
Thanks for the kind assistance as always.
Hi Jkregala,
There is a setting called "Site URL Settings" that allows changing the absolute URLs generated by Sitefinity. There are cases when Sitefinity is behind proxy or some other type of network address and port translations (e.g. NAT or PAT). In these cases the absolute URLs used for links in Sitefinity correspond to the network address of the web server and not to the real site URL. In order for the real URL to be used it has to be set via the site URL settings. These settings are situated in the Advanced Settings under SystemConfig node. There are two fields that can be set. The first one "ReplaceSiteUrl" is a Boolean field that enables/disables the replacement of the site URL. The second one "SiteUrl" defines the site URL to be used, e.g. "http://www.domain.com:80/". Places where such absolute URLs are used are the search results and the blog address in syndication feeds.
This new setting was released with Sitefinity 4.0 SP1.
Regards,
Radoslav Georgiev
the Telerik team
Does it matter if we apply the settings on either staging or prod? Or it should be on one only?
Hello Jkregala,
Since the websites are running connected to the same database you should apply the settings on both environments. Then on the staging one you should edit the hosts file of the machine so that it does not open the production url when requested but uses the site on staging.
Best wishes,
Radoslav Georgiev
the Telerik team