• Hi all,

    I have a small problem with our WP site. If I am on the homepage the URL+content is fine…If I switch to another page & then click home, the URl changes & social media widgets do not display correctly.

    I have changed the settings > general both to .org.uk, but If I cick on the home page button from another page, it goes to .16.com.

    Originally I used a free 16mb.com domain name until we purchased a .org.uk. As I did not want to lose the site that I created, I added the .org.uk as a ‘parked domain’ on the 16mb.com account’s hosting.

    I’m not sure if there was a better way to switch domains or perhaps transfer the site to a new domain?

    Any help would be appreciated!

    Many Thanks,

    Jordan

Viewing 15 replies - 1 through 15 (of 23 total)
  • There is a better way: http://codex.wordpress.org/Changing_The_Site_URL

    I recommend using the wp-config.php method first and if it is working and you want to update the options in the fucntions.php.

    NOTE: I have a few production site running using the wp-config method without a hitch.

    define('WP_HOME','http://example.com');
    define('WP_SITEURL','http://example.com');

    Thread Starter CaerphillyUnison

    (@caerphillyunison)

    Thanks,

    I have tried that. It gave me an error with the functions (something about line 2), so I took the functions update out & now the site doesn’t load at all.

    I will give it another 5mins to see if it works, if not I think that I’ll have to take the code out of wp-config.

    There should of been not errors?? what was the error it gave you?

    Thread Starter CaerphillyUnison

    (@caerphillyunison)

    “error on code line 2” when i added the code to functions.php

    Adding the line of code to the wp-config broke the site, so I have just removed it & the site works again.

    It should of gave you a syntax error.

    Thread Starter CaerphillyUnison

    (@caerphillyunison)

    It may of been a syntax error, not too sure to be honest.
    Any idea why it would be giving this error?

    Any alternative/s?

    Cheers

    Are you sure the only error it gave you was

    error on code line 2

    and not something like

    PHP Parse error: syntax error, unexpected '!' in ...... error on code line 2

    Most (if not all servers) will tell you what is wrong.

    Thread Starter CaerphillyUnison

    (@caerphillyunison)

    Ok just tried editing both again.

    This time there are no errors, but nothing has changed. THe homepage still switches to 16mb.com instead of .org.uk when clicking the home button.

    You may have code redirecting in the theme or plugin some where. Or even higher level, check you .htaccess file for redirect code.

    Thread Starter CaerphillyUnison

    (@caerphillyunison)

    The only thing in .htaccess is:
    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ – [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>

    # END WordPress

    Would it be possible to add a line in there somewhere?

    Naw.. You may have code elsewhere redirecting (theme itself, or a plugin).

    If you can edit the homepage, try simply echoing the site url to see what it is.

    <?php echo site_url(); ?>

    BTW the code to define the site URL should not trow errors. Ensure the code is right before the line.

    // ** MySQL settings - You can get this info from your web host ** //
    /** The name of the database for WordPress */
    define('DB_NAME', 'xxxxx');

    in the wp-config.php file

    Thread Starter CaerphillyUnison

    (@caerphillyunison)

    Not sure how to put <?php echo site_url(); ?> into the homepage tbh.

    define(‘DB_NAME’, ‘xxxxx’); <<< Do i need to change “xxx” to my siteaddress? Would DB_NAME be the variable name or would NAME be something else by default?

    Sorry for all the questions, new to this. I appreciate your help πŸ™‚

    Ensure the code is right before the line.

    Please do not edit or add the lines.

    You should put

    define('WP_HOME','http://example.com');
    define('WP_SITEURL','http://example.com');

    right before the line

    // ** MySQL settings - You can get this info from your web host ** //

    Make sure you change http://example.com to your domain name you want your site to be.

    Thread Starter CaerphillyUnison

    (@caerphillyunison)

    Still doesn’t work πŸ™

    Thread Starter CaerphillyUnison

    (@caerphillyunison)

    Do you think maybe I would need to create a new hosting account as .org.uk and transfer the site over (if possible). If so, any ideas how I would do this?

    Cheers

Viewing 15 replies - 1 through 15 (of 23 total)

The topic ‘Homepage URL’ is closed to new replies.