Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Wordpress install on heroku, accessing pages non root pages, server configuration

I have made a native installation on heroku of wordpress which installs well and runs. I can set it up, build pages, make posts, however when it comes to the routing, I'm having issues. I cannot seem to get the pages/posts created to show, and I keep getting a 404, whether I use ngnix or apache as the server.

For example, I'm deploying PHP 7.1.11 with Apache2, my Proc file is:

web: vendor/bin/heroku-php-apache2

The / page renders fine. But none of the subpages, for example:

xyz.com/2017/10/test/ results in a 404, as seen in the log:

2017-10-31T19:16:35.829992+00:00 heroku[router]: at=info method=GET path="/2017/10/test/" host=xyv.com request_id=84ff659b-346e-4715-b629-66e13524b64c fwd="x.x.x.x" dyno=web.1 connect=0ms service=1ms status=404 bytes=377 protocol=htt

Should there be anymore configuration in the Procfile to make this work out of the box? Ideally with prettier links, such as /articlename/

like image 695
disruptive Avatar asked Oct 28 '22 23:10

disruptive


1 Answers

Please check your permalinks settings, it should be configured so that index.php comes in your url. The reason behind it is that on nginx server index.php is required in url,

try your url with index.php for ex if your post url is xyz.com/helloworld, then in post url check with xyz.com/index.php/helloworld.

The issue is with urls try changing permalinks and set to include index.php

/index.php/%postname%/

use custom permalink option with above setting.

like image 60
DHRUV GUPTA Avatar answered Nov 15 '22 05:11

DHRUV GUPTA