Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • bh 444 posts 1544 karma points
    Aug 03, 2017 @ 12:53
    bh
    0

    404 When Previewing a Content Page

    I'm getting a 404 error when I click the preview button on a content page. I also get a 404 when I browse to the published page.

    When I look in the /views folder the appropriate *.cshtml page is there.

    Any ideas where I should be looking?

  • Alex Skrypnyk 6182 posts 24283 karma points MVP 8x admin c-trib
    Aug 03, 2017 @ 13:00
    Alex Skrypnyk
    0

    Hi Bh

    What about normal view of page, is it working?

    Thanks,

    Alex

  • bh 444 posts 1544 karma points
    Aug 03, 2017 @ 13:07
    bh
    0

    @AlexSkrypnyk "normal view" is not working either.

  • Alex Skrypnyk 6182 posts 24283 karma points MVP 8x admin c-trib
    Aug 03, 2017 @ 14:19
    Alex Skrypnyk
    0

    What if you republish the node?

    Maybe the node is restricted from access?

    What version of Umbraco are you using?

  • bh 444 posts 1544 karma points
    Aug 03, 2017 @ 14:31
    bh
    0

    @AlexSkrypnyk

    I've published the node a half dozen times. Still 404.

    Restricted from access...I don't beleive so. I don't have any security groups setup.

    I'm running Umbraco 7.6.4

  • Alex Skrypnyk 6182 posts 24283 karma points MVP 8x admin c-trib
    Aug 03, 2017 @ 14:31
    Alex Skrypnyk
    0

    What about some rewriting rules?

  • bh 444 posts 1544 karma points
    Aug 03, 2017 @ 14:33
    bh
    0

    There are no rewrite rules specified in my web.config

  • Alex Skrypnyk 6182 posts 24283 karma points MVP 8x admin c-trib
    Aug 03, 2017 @ 14:49
    Alex Skrypnyk
    0

    If you would have the problem with template - then the error will be:

    No physical template file was found for template
    

    404 error - something with wrong url

    What URL Umbraco shows in backoffice and what you are trying to access?

    Everything ok with domain binding or it's local installation?

  • bh 444 posts 1544 karma points
    Aug 03, 2017 @ 15:00
    bh
    0

    Other pages work fine. Even if I'm using the wrong URL when I browse to it...the preview button URL I can't screw up, and it's not working. Which tells me something is wrong.

    As far as the URL I'm using...

    Here's my top nav code...

    @inherits Umbraco.Web.Mvc.UmbracoTemplatePage
    
    <!-- Top Nav -->
    @{
        var homePage = CurrentPage.AncestorsOrSelf(1).First();
    
        // The menu items we want are all of the children of the homepage
        // We also check if "Hide in navigation" is on in the menu, we shouldn't show hidden items
        var menuItems = homePage.Children.Where("includeInNavigation == true");
    }
    
    
    
    <ul class="nav navbar-nav"> 
    
    @{int i = 0;}
    @foreach (var item in menuItems){
        if (i==3){
            <li class="sticky-logo hidden-xs"><a href="#"><img src="/img/logo.png" /></a></li>
        }
        if (item.Children.Where("includeInNavigation == true").Count() > 0){
            <li class="dropdown @(i < 2 ? "border-right" : "") @(i > 2 ? " right" : "")"><a href="@item.Url" role="button" aria-haspopup="true" aria-expanded="false">@item.Name <i class="fa fa-chevron-down blue" data-toggle="dropdown" aria-hidden="true"></i></a>
                <ul class="dropdown-menu">
                    @foreach (var subMenuItem in item.Children.Where("includeInNavigation == true")){
                        <li><a href="@subMenuItem.Url">@subMenuItem.Name</a></li>
                    }
                </ul>
            </li>
        }else
        {
            <li class="@(i < 2 ? "border-right" : "") @(i > 2 ? "right" : "") @(item.Name == "Connect" ? " connect" : "")"><a href="@item.Url">@[email protected]((item.Name == "Connect" ? " <i class='fa fa-chevron-right hidden-xs' aria-hidden='true'></i>" : ""))</a></li>
        }
        i++;
    }
    
    </ul>
    
  • Alex Skrypnyk 6182 posts 24283 karma points MVP 8x admin c-trib
    Aug 03, 2017 @ 15:11
    Alex Skrypnyk
    0

    This view looks like ok, what about view of pages and master template?

  • bh 444 posts 1544 karma points
    Aug 03, 2017 @ 15:17
    bh
    0

    I have multiple other pages that work fine using the same master template.

  • Alex Skrypnyk 6182 posts 24283 karma points MVP 8x admin c-trib
    Aug 03, 2017 @ 16:12
    Alex Skrypnyk
    0

    what about page templates?

    custom routing?

    RenderControllers?

  • bh 444 posts 1544 karma points
    Aug 03, 2017 @ 16:31
    bh
    0

    I've commented out everything on the page template except one h1 just so it doesn't come back null. Don't think it's the page template.

    I'm not doing any custom routing.

    I'm not familiar with RenderControllers.

  • Alex Skrypnyk 6182 posts 24283 karma points MVP 8x admin c-trib
    Aug 03, 2017 @ 23:10
    Alex Skrypnyk
    0

    RenderController is a controller that does the stuff before rendering the page for certain document type, read more here -

    https://our.umbraco.org/documentation/reference/routing/custom-controllers

  • bh 444 posts 1544 karma points
    Aug 04, 2017 @ 11:57
    bh
    0

    I'm not using any RenderControllers.

    @AlexSkypnyk I'd love to do a screen share with you and show you my setup, so you could see what I've got going on and if anything appears to be setup incorrectly. But, I realize that's a lot to ask. Please let me know if you're interested.

  • Alex Skrypnyk 6182 posts 24283 karma points MVP 8x admin c-trib
    Aug 05, 2017 @ 10:49
    Alex Skrypnyk
    0

    Hi Ben

    Yes, I can look, how can I do it?

    Write me on twitter, I started following you.

    Thanks,

    Alex

  • bh 444 posts 1544 karma points
    Aug 07, 2017 @ 16:31
    bh
    100

    Figured it out. I didn't have a template selected on my content node.

Please Sign in or register to post replies

Write your reply to:

Draft