Jump to content

Recommended Posts

Posted

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

Posted

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

Posted

Looking at your image makes me think you are not on a current version of ProcessWire.  What are your versions of ProcessWire, PHP?  Thanks.

Example - Older Version of ProcessWire (2.3.0)

post-756-0-86829900-1447253523_thumb.png

Example - New Version of ProcessWire (2.6.22 Dev)

post-756-0-18275600-1447253538_thumb.png

Posted

Ok, that's not it.  Ensure that your access control permissions on the "home" template are not precluding access to these pages?  Are you using any third-party module or code that has the potential to block access to these pages?

Posted

Hello,

                  I completely renamed the module directory but even after doing so the page showed 404 rather than showing error. Also, all the existing pages are viewable except for the new pages getting created.

Posted

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

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
×
×
  • Create New...