Virtual Happy Hour this month, Jun 28, we'll be getting a sneak preview at our soon to launch SaaS CMS!

Try our conversational search powered by Generative AI!

"View on Website" link gives 404 error when pages other than start page are viewed


I get a 404 error for pages other than start page when the "View on Website" link is clicked.

Is there way to resolve this ?

Any help would be highly appreciated

Apr 28, 2022 13:55

If you are running on DXP, can you open the log stream and look for any errors?

May 12, 2022 18:02
snehjadh - May 16, 2022 6:56
Hi Kenny,

Yes, it gives error in UrlService but since this error occurs only in Production site. Its difficult to debug in local. Its not reproducible in other environments Edit mode
KennyG - May 17, 2022 13:51
You said UrlService gives an error. What is that error?

Couple of things you can try. Depending on your experience, you may just ignore me:

  • pages you are trying to view, are they published?
  • What language has the page been created in and is that the language setup against the site in 'manage website?'
  • How are your controllers and views setup in the code against the page type you've created? Can you download the alloy cms site and compare your MVC structure?
May 12, 2022 22:19
snehjadh - May 16, 2022 6:59
Hi Surjit,

The pages are published. View on website worked fine in March. It gives 404 from April onwards although nothing has been changed in Manage Website
  1. Is the site domain set up correctly in manage websites in admin mode? 
  2. Can you browse content on the front end normally? If so can you compare the URL generated at the front end compared to the one you get with the "View on website" link
May 13, 2022 14:47
snehjadh - May 16, 2022 7:07
Hi David,

Yes the domain is correctly set in Manage website as it was working until March. There hasn't been any changes done for the error to pop.
We can browse the content on front end. The URL with Type Edit is set in the Edit mode which throws Error when View on Website is clicked. This Edit mode URL works fine when language is added in URL eg.
Daniel Ovaska - Jun 22, 2022 12:21
Have you set the default language on the host setting and also set as primary?

Hello, Are there any URL intercepters included after March? Can you check if this was set to child tree components other than the root. It sounds like if start page is working then this shouldn't be a problem with domain configuration. Since this is happening only for child components, Are there chances if pagetypes were changed with no view file? Is this redirecting them to somewhere else?

May 16, 2022 11:08

Another problem could be if the StartPublish date is being manipulated with code. See the blog which mentions the scenario 

May 17, 2022 13:47
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.