404
0

At the very first day while we were trying to make this site (onlybug.com) live, we ran into very obvious error, “404! page not found”. Seems Pretty Funny Right ? well, it wasn’t funny at the time though. It was pretty obvious Permalinks Issue with WordPress

How it happened

We developed the basic (just kidding, we just installed theme) in our local environment using Local By Flywheel which is pretty good tool for WordPress development (will talk about it’s bugs later) and then imported it into our server hosted on aws using plesk.

Everything went smooth (not actually but yeah we did it) and it was live. At this time, we started testing each features and making sure everything was working correctly and then BOOM! the first link I clicked didn’t open.

The first steps

As like any other developer, I googled the issue, ran over many blogs of plesk and found number of solutions with the tag “solved” but none worked for me.

With over 6 years of career on WordPress development, my whole team looking at me, I had a pressure resolve it and make it live anyhow. So as usual, I used developers ultimate weapon of debugging “Hit-and-trial”.

Re-uploaded all core WordPress files, flushing permalinks, reseting server settings and configuration files, and even rebooting the server (I don’t know why but I did it anyway).

After a long hit-and-trial session, out of nowhere I thought it might be SSL issue and I wanted to force redirect all the request from http to https. I searched for .htaccess and right there, yes my fellow frustrated developers who are currently reading this, right there there was no ".htaccess." file.

How did it got solved?

I just created .htaccess and copied following code from WordPress.org and Damn! it worked.

# BEGIN WordPress
RewriteEngine On
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
# END WordPress

I would say that it was pretty stupid of me and my team, but ehh! just a regular day in life of a developer. Who cares!

Comments
Codemadan

You may also like

Comments

Leave a reply

Your email address will not be published. Required fields are marked *