Jump to content

404 on any new published pages


Rajesh Khanna
 Share

Recommended Posts

Hello ,

                     We are developing a website where we have been facing a 404 Error on all new pages those are getting created. We are able to view all the pages those are already created. When we create a new page and try to access the page we get 404 , but we can access all the fields of the page in another page. Url of the page is also correct.

                     Below are the troubleshooting steps we tried but failed to resolve the issue :

                     a) We had procache enabled , so we were having the modifed .htaccess , we changed our .htaccess to original version didtributed alongwith processwire.

  

                     b) We tried deleting few pages and then recreating them but didnot help in resolution.

                    c)  We also tried changing the server but it also didnot resolve the issue.

                       * Rememeber the status of page is publish.

                      Please assist in resolving the issue

Link to comment
Share on other sites

Hello 
             Sir, thanks for your assistance. please find below code which i wrote to test if the page is viewable or not .

             I got page is viewable and user has the permission to view the page for both guest and admin but still once i go through the url i get 404.
 

$page_is_created = wire("pages")->get("url/of/the/page");

if($page_is_created->viewable())echo "{$page_is_created->id} : page is viewable";
else echo "Page is not viewable";

if($user->hasPermission('page-view', $page_is_created)) {
  echo "Yes";
} 

 
 
post-2245-0-89902900-1447247313_thumb.pn

Link to comment
Share on other sites

Couple of things spring to mind.

1. Are you actually publishing the pages as well as saving them - by default saved pages are set to be unpublished --- if the page is set to unpublished then even though it exists you will not be able to see it via a url. Easiest way to check is look in the pages tree, the page title should show as bold text -- if it has a line through it but it is bold then that's fine, it just means you've not checked the box to have the page appear in menus and/or searches.

2.Have you checked in the templates directory that there is a php file with the same name as the template your page is using. If this php file is not present then the page will not display.

Hope that helps

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...