Support » Localhost Installs » Localhost links incorrectly rewriting to live site

  • Every link in my localhost redirects to the live site. The url before clicking reads localhost/blog/year/month/day/post but then redirects to live site homepage. I believe this is a problem revolving around permalinks, apache mod_rewrite but as far as I know I have my .htaccess setup correctly. Any help would be greatly appreciated

Viewing 8 replies - 1 through 8 (of 8 total)
  • Did you do a search and replace on the database to replace all instances of the live site domain name with “localhost” prior to importing the database to the local installation? If yes, try making the local .htaccess file writable to wordpress, and then refresh/update the permalinks and see if that has any effect.

    Some documentation on Moving WordPress and a cautionary statement about serialized data and using plugins to search and replace in the database

    Thanks for replying ClaytonJames.

    I did in fact search and replace the domain name. If i change the permalink structure to default about half of the links work (mainly posts, but a few pages too) but most links to pages still rewrite to the live site. This is why I believe it’s a mod_rewrite issue

    Is mod_rewrite installed and working on the local server, and has the AllowOverride Directive for the local site been set to ‘All’?

    Yes to both

    Have you tried renaming/removing the old .htaccess file and creating a new, empty .htaccess then allowing WordPress to re-write/reset your permalinks?

    Yup. Tried that multiple times already. No resolution

    This is just a stab in the dark at this point, but is there any chance that when you copied the live site files, you downloaded an active caching plugin and some cached files from the live site into the local site?

    Yes I am using a caching plugin. I tried removing and redownloading all the files except for plugins and emptied my cache. No luck

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Localhost links incorrectly rewriting to live site’ is closed to new replies.