Running Wordpress Locally

by 5 replies
6
Hi,

I just installed WP on my local WAMP server to make some mods, but when I am previewing it, it keeps re-directing me to my online website.

I think this is the setting in the control panel where you set the url for the website. I need to find that entry in database and adjust it to localhost. Does anyone know where it is?

Thanks
#programming #locally #running #wordpress
  • As is always the case, right after I post I find it. Was in options table. I have a lot of extra tables in this database so it was confusing me.
  • Look at the config table.
    The value is your URL.
  • Well, the index page works. All internal pages are not found for some reason.
  • WordPress uses absolute URL's in the wp_posts table in a couple of fields

    1- The "guid" field

    2 -The "post_content" field (for posts linked to one another internally)

    A Couple of queries to get you going - replace 'http://www.new-domain.com' with whatever you defined your new installation on your local machine as:

    Code:
    UPDATE wp_posts SET guid = replace(guid, 'http://www.old-domain.com','http://www.new-domain.com');
    
    UPDATE wp_posts SET post_content = replace(post_content, 'http://www.old-domain.com', 'http://www.new-domain.com');
    Hope this helps!

    Bill
  • Thanks. I found out the 404 error was because i needed to enable rewrite on apache.

    Thanks again.

Next Topics on Trending Feed