This is my website The home page shows, but all links start with localhost/wordpress, rather than the current address, which is

The server is windows and runs IIS 7. Wordpress is in C:\inetpub\wwwroot\wordpress. Wordpress is installed by Web Platform Installer.

I'm new to IIS. How should I fix the link problem?

I hope I don't have to reinstall wordpress.


You should be able to configure the URL that WP uses for the links in the backend, at Settings->General.


Yes, because you did not change all domain URL values stored in database, mostly on posts.

There are two solutions. (second one is recommended)

  1. Either define these variables in wp-config.php. These will override any domain URL values stored in database.

    define( 'WP_HOME', '' );
    define( 'WP_SITEURL', '' );

This will work fine but if you ever delete these lines from wp-config.php, your wordpress will start using URL from database. So http://localhost/wordpress will be displayed

  1. Run SQL query to modify URLs permanently. From phpmyadmin or any other solution.

    UPDATE wp_options SET option_value = replace(option_value, 'http://www.oldsite.com', '') WHERE option_name = 'home' OR option_name = 'siteurl';
    UPDATE wp_posts SET guid = replace(guid, 'http://www.oldsite.com','');
    UPDATE wp_posts SET post_content = replace(post_content, 'http://www.oldsite.com', '');

Don't forgot to replace http://www.oldsite.com with your old urls in above SQL queries. I think you have http://localhost/wordpress

  • If I have two domain names, if I visit it by www.name1.com, wordpress's links start with name1, if I visit it by www.name2.com, the links start with name2. I think it is what relative url does. Doesn't wordpress support? – Gqqnbig Aug 30 '14 at 8:47

Add "https://" before the link and add target = "_blank"


var url = "gmail.com";

if(!url.match(/http/g)) {
    var addHead = "https://";
    var url = addHead + fileName;
} else {
    var url = fileName;

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.