0

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

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.

migrated from serverfault.com Aug 28 '14 at 11:41

This question came from our site for system and network administrators.

1

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

1

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', 'http://173.214.165.83' );
    define( 'WP_SITEURL', 'http://173.214.165.83' );
    

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', 'http://173.214.165.83') WHERE option_name = 'home' OR option_name = 'siteurl';
    UPDATE wp_posts SET guid = replace(guid, 'http://www.oldsite.com','http://173.214.165.83');
    UPDATE wp_posts SET post_content = replace(post_content, 'http://www.oldsite.com', 'http://173.214.165.83');
    

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
0

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

JavaScript:

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.