page not found in Chrome, but found in Firefox

You are sending a very confusing response: HTTP/1.1 301 Moved Permanently Date: Sat, 20 Oct 2012 12:33:06 GMT Server: Apache X-Powered-By: PHP/5.3.13 X-Pingback: http://tech.doig.com.au/xmlrpc.php Keep-Alive: timeout=5, max=100 Connection: Keep-Alive Content-Type: text/html; charset=UTF-8 After that the regular page content follows. So in your first line you tell the browser to look elsewhere for the content. But … Read more

Where is the best part to hijack or catch a potential 404

It’s not possible to catch a non–match to template in WP because it will always match some template. The very last template it will fall back to will simply be index.php, the most generic one in template hierarchy. In general the appropriate hook for such logic is typically template_redirect in template-loader.php. At this point the … Read more

404 error on all pages but homepage

Assuming you are on Linux, you need to make some changes in apache2.conf file stored in /etc/apache2 directory. Open the file with root permissions, you will find the code given below in the file. <Directory /var/www/> Options Indexes FollowSymLinks AllowOverride None Require all granted </Directory> Here just change the AllowOverride None to AllowOverride All, save … Read more

Non “WordPress” pages/code getting 404 error

The problem your having is because of the way the WordPress rewrite system works. The WordPress .htaccess sends all requests (that dont actually exist except index.php) through the index.php file in the WordPress root directory. If any request is made for a file named index.php it will also get sent through the root WordPress index.php. … Read more

Detect 404 before headers are sent

Use a later action hook You cannot use Conditional Tags before the posts_selection hook has run (as per the codex), which happens right after pre_get_posts and quite a bit after init. Hence, would it not be easier to set the cookie at a later stage of the request, rather than attempting to detect the 404 … Read more

Changing Site Address (URL) causes 404

Go to phpMyAdmin and select the database for the website. Go to the “wp_options” table and edit the first option (option_name: siteurl) from “http://www.example.com/wordpress” to “http://www.example.com/somethingelse“. In the same “wp_options” table, look for “option_name: home” and change the URL there too. Now, rename your current .htaccess file to .htaccess_old and create a new blank .htaccess … Read more

WordPress REST API 404

I commented this, for my situation: I have this same issue. I’m on an Ubuntu-server, but I’ve simply pointed my host-file to point to the IP. I must admit I’m not 100% sure how the restful API works, if that has any effect or not. I’m on WP version 4.9.8, – and have the problem … Read more

REST API: No route was found matching the URL and request method

It’s because of how you’ve defined the accepted methods: ‘methods’ => ‘\WP_REST_Server::CREATABLE ‘, You shouldn’t have quotes around it. WP_REST_Server::CREATABLE is a string that equals ‘POST’, but by putting quotes around it you’re literally setting the method as ‘\WP_REST_Server::CREATABLE’, which is not a valid HTTP method. You can see this in the response to the … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)