Skip to main content
edited tags; edited title
Link
cybmeta
  • 20.6k
  • 5
  • 47
  • 56

Moving Relative links stop working after moving wordpress site from hosting to localhost for development

Source Link
rokpoto.com
  • 224
  • 3
  • 13

Moving wordpress site from hosting to localhost for development

After moving website to my local dev machine, relative links stopped working. When i click button with relative link /login, for example, browser redirects to

https://localhost/login/

and shows

Code: Not Found

The requested URL /index.php was not found on this server.

While it should have redirected to https://localhost/сс/login/

.htaccess contents on localhost:

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /cc/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /cc/index.php [L]
</IfModule>
  1. Website files are in var/lib/html/cc folder.
  2. SiteURL and HomeUrl are both equal to http://localhost/сс
  3. Parmalinks setting http://localhost/cc/sample-post/ is used, so no problem with navigating to pages.

How to fix this issue?

Tried different .htaccess modifications, moving index.php to /var/lib Nothing helps.