The requested URL was not found only on localhost

I have moved WordPress files database from localhost to live server successfully. However, now when I try to move it back to localhost the links doesn't work, although they should.

I am using root-relative links in my hrefs as in: href=/about-us

I am using the plugin All in One WP Migration.

Have tried the following:

  • Multiple .wpress backup files from the plugin,
  • Reinstalled XAMPP,
  • Several different database names for local WP installation,
  • Severeal different usernames for local WP installation,
  • Several different theme names for local WP installation,
  • Matched database, username and theme name Exactly as live WP installation,

After WP migration have tried:

  • Selecting all the other permalink structures in addition to postname,
  • Saving permalink structure twice after WP Migration,
  • Cleared cache with Google Inspector,
  • And maybe something more.

All the guides seem to use this plugin with ease and none really faces this issue or talks about it so it's quite confusing.

Note: If I change from /about-us to about-us it works but I do not want it this way. Also I want to make this work with this specific plugin.

Thanks!

//Edits below

Seems to be an issue with Apache. When comparing .htaccess file content between live and localhost (after migrating site with plugin), this is the result:

Live site .htaccess content:

IfModule mod_rewrite.c
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]
/IfModule

Local site .htaccess content:

IfModule mod_rewrite.c
RewriteEngine On
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteBase /viktoria-cafe-konditori/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /viktoria-cafe-konditori/index.php [L]
/IfModule

I see that there are differences on the RewriteBase line and on the last RewriteRule line.

I tried to copy all content from live .htaccess to local .htaccess - problem persists.

Topic urls migration Wordpress

Category Web

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.