Resolve 404 on posts without category

Ok, resolved it in 404.php <?php $klo_link = $_SERVER[‘REQUEST_URI’]; if (preg_match(“/^\/[a-zA-Z0-9\-\_]+\/$/”, $klo_link)) { //echo “A match was found. \n”; //echo $klo_link; header(“HTTP/1.1 301 Moved Permanently”); header(“Location: “.get_bloginfo(‘url’).”/a”.$klo_link); exit(); }else { get_header(); } Put that at the beginning of the 404.ph

WordPress refuses to read the .htaccess file and gives a 404 for sub-pages

Even though the 000-default.conf file had… <VirtualHost *:80> ServerAdmin webmaster@localhost DocumentRoot /var/www/html <Directory /var/www/html/> Options FollowSymLinks AllowOverride All Require all granted </Directory> ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined </VirtualHost> I had to place… <Directory /var/www/html/> Options FollowSymLinks AllowOverride All Require all granted </Directory> Into the apache2.conf And use the sudo service apache2 restart command.

Page not found (404 Error) even if the page exists?

Change your current permalink structure to the WordPress Default Permalink structure and then again change it back to your current permalink structure. Hope it will work! If not then clear your browser cache and use Wp Super Cache plugin to clear WordPress Cache. and then open the URL test.mydomain.com/wordpress/hello/

Pagination 404s on custom query

There are a couple of things I don’t understand here, but I’ll try answering them as I go along. You have a home.php, which I assume is your default homepage. You have one line of code in there, and that is to call a another page template. Here is you code <?php require dirname( __FILE__ … Read more

WordPress suddenly changed all links to example.com/example.com/

Check your .htaccess file for the proper values. Here’s what WP recommends; you may need to adjust for your configuration (from here; more examples that might help) https://codex.wordpress.org/htaccess # BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index\.php$ – [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule> # END WordPress … Read more