Will share my experience. Usually on the Preview/Staging servers, the Websites were hosted in sub folders. for example:
http://preview*****.test.com/nl_nl for our netherlands website.
The issues we faced on our Preview website were the same as of yours:
- Images NOT displaying
- Layout/Appereance/alignments issue
- Links not working / 404 on clicking links
Below are our observations on Environment setup and the resolutions:
Publication Url was set to / in Publications property, thus it didn't accounted for the subfolder
Seeing the websites were hosted as subfolders on
Preview but as a separate Website in IIS on Live servers, it didn't make any sense to change the Properties:
Publication Path/Url and
Images Path/URL of the Publication.
- [ CSS/JS Path Issue ]:
cd_storage_conf.xml has below setting present for the nl website:
<Storage Type="filesystem" Class="com.tridion.storage.filesystem.FSDAOFactory"
<Root Path="E:\Preview-stage\preview****.test.com" />
You see the
Path value is incorrect. The subfolder
nl_nl is missing. This was forcing the Published Content to go to wrong directory.
Correct Setting is:
<Root Path="E:\Preview-stage\preview****.test.com\nl_nl" />
Also, The Template code( PT DWTs) had references to many CSS / JS through that usual
<link rel="" /> and
<script .../> way. We corrected the template code, so that when a Page is published to Preview server, the path to such resources (CSS/JS) are corrected.
[Link Issue]: The dynamic link resolver config file:
cd_link_conf.xml was missing an Entry for this Publication.
The below entry was missing/incorrect for few websites earlier. This entry also decides how URLs to images and other resources are constructed.
<Host Domain="preview......solutions.com/nl_nl" Port="80" Path="/" />
<Linking ComponentAnchors="false" AddComponentLinkInfo="false" />