Solved WordPress Cutover Main Page Works, but Secondary Pages Do Not
-
So this is odd, I have a WordPress site that I am moving from one server to another. It's essentially a straight move, nothing to weird. The old server is straight Apache and the new one has a Varnish cache and an nGinx reverse proxy in front of it. If we do the move the landing page works great in both cases. But after moving additional pages like "about us" no longer work, they go nowhere as if there was no such link. It seems like unlikely behaviour, I'm trying to think of why this might happen. Where should I be looking (other than the logs which I am off to dig into now.)
-
BANGING HEAD ON DESK
It's an Ubuntu-ism. On Fedora this is not needed. On Ubuntu you have to...
a2enmod rewrite
-
@scottalanmiller said in WordPress Cutover Main Page Works, but Secondary Pages Do Not:
So this is odd, I have a WordPress site that I am moving from one server to another. It's essentially a straight move, nothing to weird. The old server is straight Apache and the new one has a Varnish cache and an nGinx reverse proxy in front of it. If we do the move the landing page works great in both cases. But after moving additional pages like "about us" no longer work, they go nowhere as if there was no such link. It seems like unlikely behaviour, I'm trying to think of why this might happen. Where should I be looking (other than the logs which I am off to dig into now.)
-
Did you copy the database & files from the new server?
-- If not, then check and make sure you have pretty URLs turned on in WP.
-- If you did, then check and make sure you have a working .htaccess file
-- Also check and make sure AllowOverride is set correctly. -
Does the new server have the same URL?
-
-
@dafyre said in WordPress Cutover Main Page Works, but Secondary Pages Do Not:
Did you copy the database & files from the new server?
Yes, and they are working. WordPress runs.
-
@dafyre said in WordPress Cutover Main Page Works, but Secondary Pages Do Not:
If you did, then check and make sure you have a working .htaccess file
It's the same one that was working before, as it was copied. However, the new server has those new caches, so could they be messing with it?
-
@dafyre said in WordPress Cutover Main Page Works, but Secondary Pages Do Not:
Does the new server have the same URL?
Yes
-
Definitely whatever is happening, it is not even trying to hit the WP application. The server reacts totally differently if I hit the root and it processes the request, or if I don't, it's an instant fail.
-
@dafyre said in WordPress Cutover Main Page Works, but Secondary Pages Do Not:
Also check and make sure AllowOverride is set correctly.
Sure seems to be.
-
BANGING HEAD ON DESK
It's an Ubuntu-ism. On Fedora this is not needed. On Ubuntu you have to...
a2enmod rewrite
-
@scottalanmiller said in WordPress Cutover Main Page Works, but Secondary Pages Do Not:
BANGING HEAD ON DESK
It's an Ubuntu-ism. On Fedora this is not needed. On Ubuntu you have to...
a2enmod rewrite
Yup, even for enabling PHP too...
-
@scottalanmiller said in WordPress Cutover Main Page Works, but Secondary Pages Do Not:
BANGING HEAD ON DESK
It's an Ubuntu-ism. On Fedora this is not needed. On Ubuntu you have to...
a2enmod rewrite
What's that?
-
You should look at the mod_rewrite rules. It's pretty obvious that the problem lies with the url rewriting.
Either the reverse proxy is wrongly configured or the apache webserver.
Actually it's probably best to follow the entire chain. Remember that you can active the rewrite modules logging as well.
A small thing like using a different directory will make the rewrite rules invalid.
-
@Obsolesce said in WordPress Cutover Main Page Works, but Secondary Pages Do Not:
@scottalanmiller said in WordPress Cutover Main Page Works, but Secondary Pages Do Not:
BANGING HEAD ON DESK
It's an Ubuntu-ism. On Fedora this is not needed. On Ubuntu you have to...
a2enmod rewrite
What's that?
That's a script that enables the mod_rewrite module in apache - apache2 enable module.
-
@Obsolesce said in WordPress Cutover Main Page Works, but Secondary Pages Do Not:
@scottalanmiller said in WordPress Cutover Main Page Works, but Secondary Pages Do Not:
BANGING HEAD ON DESK
It's an Ubuntu-ism. On Fedora this is not needed. On Ubuntu you have to...
a2enmod rewrite
What's that?
It's what enables rewrite to work at all.
-
Ok ensure .htaccess file is present and has good permission
try chmod something open to the docroot and chown like www-data:www-data for whole docroot just for test
Use wordpress cli to change the site URL home and URL address to the correct values after site move
define( 'WP_HOME', 'http://example.com' );
define( 'WP_SITEURL', 'http://example.com' )You can use the portable phar
https://gist.github.com/pcsontos/122fceb3d6e6e43da98d
wp-cli.phar option update home 'http://example.com'
wp-cli.phar option update siteurl 'http://example.com' -
@scottalanmiller said in WordPress Cutover Main Page Works, but Secondary Pages Do Not:
BANGING HEAD ON DESK
It's an Ubuntu-ism. On Fedora this is not needed. On Ubuntu you have to...
a2enmod rewrite
Ah, so the problem was just that the mod_rewrite module wasn't enabled in Apache.
It's the LoadModule entries in the httpd.conf file that tells Apache which modules to load. Using a2enmod is mostly for convenience.
-
@scottalanmiller said in WordPress Cutover Main Page Works, but Secondary Pages Do Not:
BANGING HEAD ON DESK
It's an Ubuntu-ism. On Fedora this is not needed. On Ubuntu you have to...
a2enmod rewrite
Gotta love those Ubuntu-isms that exist just to slow us down. You all know how much I like Ubuntu.
-
@Pete-S said in WordPress Cutover Main Page Works, but Secondary Pages Do Not:
@scottalanmiller said in WordPress Cutover Main Page Works, but Secondary Pages Do Not:
BANGING HEAD ON DESK
It's an Ubuntu-ism. On Fedora this is not needed. On Ubuntu you have to...
a2enmod rewrite
Ah, so the problem was just that the mod_rewrite module wasn't enabled in Apache.
It's the LoadModule entries in the httpd.conf file that tells Apache which modules to load. Using a2enmod is mostly for convenience.
Right, coming from doing this in Fedora regularly, it didn't occur to me that there was a manual step as Fedora defaults to turning that on.
-
@travisdh1 said in WordPress Cutover Main Page Works, but Secondary Pages Do Not:
@scottalanmiller said in WordPress Cutover Main Page Works, but Secondary Pages Do Not:
BANGING HEAD ON DESK
It's an Ubuntu-ism. On Fedora this is not needed. On Ubuntu you have to...
a2enmod rewrite
Gotta love those Ubuntu-isms that exist just to slow us down. You all know how much I like Ubuntu.
We know but hey I know it
-
Well let's talk about fedora and updating killing a laptop lol....