WordPress.org

Ready to get started?Download WordPress

Forums

Assign exiting url to wordpress site (14 posts)

  1. deepbevel
    Member
    Posted 2 years ago #

    Hi
    I made a wp site for a client as a subdomain but now I can't get it to use the url from her current site.

    I changed the name of the site in both feilds under settings/general and got kicked out, as I expected because that's what always happens. However when I add the new url info to either wp-config, the data base, or functions.php I still get "page cannot be found"

    I don't understand how wp works on a server because there's no index.html, like I've been used to.

    What am I missing? how does the url associate with a wp site? where is the path defined?

    This is the old url that still brings up a "Page not found" error through the site. It's the path to the wp folder:

    http://hollymedbery.com/hollymedbery-wp/

    But the url I'm trying to use is just

    http://hollymedbery.com

    which doesn't even connect to the site.

    Do I need to rename the folder? I don't know what else to try.

    thanks

  2. ClaytonJames
    Member
    Posted 2 years ago #

    Looks like you installed in a sub-directory, rather than a sub-domain. This may answer some questions for you: Moving WordPress

  3. deepbevel
    Member
    Posted 2 years ago #

    thanks, I've been there many times already.
    Can you tell me how I define the path to the folder which has the wp site? I already changed the name in the data base and added it to wp-config as well, but neither of those ask for a folder name or path to the folder. So I don't understand how the site can be found.

    thanks

  4. deepbevel
    Member
    Posted 2 years ago #

    I'm just not understanding how any of the info on "Moving WordPress" applies to making a wp site in a subdirectory, then getting it to use the url of an existing website that is not wordpress...?

    What's worse is I've doone it befere but I didn't understand how it was working so I don't remember, except that it was confusing and took most of the day each time.

  5. ClaytonJames
    Member
    Posted 2 years ago #

    then getting it to use the url of an existing website that is not wordpress...?

    My bad, clearly I did not correctly interpret your intentions.

    You can indeed leave wordpress in the sub-directory and still serve it from "root". Those directions can be found here: Giving WordPress Its Own Directory a bit of a tedious read, but in a nutshell it tells you how to have your wordpress files in a sub-directory, but serve them from "root". Read step 4 under "Using a pre-existing subdirectory install" very carefully please.

    Just some additional info/reminder:

    - wordpress uses .php files, not .html, so the index file is going to be "index.php"

    - you cannot serve two sites from the root. An index.php and index.html in the same directory will result in only one being served, depending on preferences set in the web server config.

  6. deepbevel
    Member
    Posted 2 years ago #

    Thanks Clayton, you seem familiar, think you may have helped me before. I'll see what I can do with this info.

  7. deepbevel
    Member
    Posted 2 years ago #

    By the way, I wasn't sure how to keep the domain from associating with the old site, which is still in the root directory. So I renamed index.html to index2.html. ..what's the correct way to handel this? perhaps this is even part of my issue?

  8. ClaytonJames
    Member
    Posted 2 years ago #

    I think you're okay that way. You won't be able to reach the existing site anymore, but once you have the index.php from wordpress copied over, that one should load wordpress automatically instead. You just can't run both from the same directory.

  9. deepbevel
    Member
    Posted 2 years ago #

    9. Change the following and save the file. Change the line that says:
    require('./wp-blog-header.php');
    to the following, using your directory name for the WordPress core files:
    require('./wordpress/wp-blog-header.php');

    Clayton, I don't understand what they mean, is it

    require('./root-domain/folder-that has wp-in-it');

    ?

  10. deepbevel
    Member
    Posted 2 years ago #

    This is what I did in wp-config,
    require('.http://hollymedbury.com/hollymedbery-wp/wp-blog-header.php');
    ?>
    The site shows up with some of the style elements missing, and some plugins not working.

    http://hollymedbery.com/hollymedbery-wp/

    Also, as you can see, still shows the folder name in the url:

    The last time I was able to log into admin, the wordpress address was the site directory, the url was the domain root. I have the same in the data base, "home" is the site directory, "url" is the root-domain.

    Otherwise I also copied htaccess to the root as instructed.

  11. deepbevel
    Member
    Posted 2 years ago #

    In index.php:

    require('.http://hollymedbery.com/hollymedbery-wp/wp-blog-header.php');

    In wp-config:

    define('WP_HOME','http://hollymedbery.com/hollymedbery-wp');
    define('WP_SITEURL','http://hollymedbery.com');

    In functions.php:

    update_option('siteurl','http://hollymedbery.com');
    update_option('home','http://hollymedbery.com/hollymedbery-wp');
    `
    and in the data base:
    wp-options/home/http://hollymedbery.com/hollymedbery-wp
    wp-options/siteurl/http://hollymedbery.com

    And, I copied php-config and htaccess to the public_html folder/root domain.

    But I can't log in to admin to check the general settings. Can you tell if I have the above correct? is there anything else I can try?

  12. deepbevel
    Member
    Posted 2 years ago #

    I reverted everything, now the old root domain goes to the old site again and the wp site in the sub directory works like before.

    The domain/url I want to use is "http://hollymedbery.com"

    the name of the wp installation folder in the hollymebery.com root directory is called "hollymedbery-wp".

    So, I'm obviously having trouble understanding the instructions in the http://codex.wordpress.org/Giving_WordPress_Its_Own_Directory, if they are indeed correct and apply to my situation.

    Would you be so kind as to clairify some of it for me?

    In the box for Site address (URL): change the address to the root directory's URL

    so, do I not have to change anything in the "WordPress Adress URL" feild?

    Copy (NOT MOVE!) the index.php and .htaccess files from the WordPress directory into the root directory of your site (Blog address).

    Doesn't htaccess change after you update permalinks? am I supposed to re-copy htaccess after I update premalinks?

    6. Change the following and save the file. Change the line that says:
    require('./wp-blog-header.php');
    to the following, using your directory name for the WordPress core files:
    require('./wordpress/wp-blog-header.php');

    Can you give me an example of how this should look when I supply my own values? I don't know if "wordpress" is supposed to be the root, the root/subdirectory, or if it should have http:// in front.

    And finally, as mentioned, number 8 says I should update permalinks, but back in number 4 it said to copy my htaccess file to the root. So am I supposed to re-copy the updated htaccess to the root again after I update permalinks?

    thanks!

  13. ClaytonJames
    Member
    Posted 2 years ago #

    9. Change the following and save the file. Change the line that says:
    require('./wp-blog-header.php');
    to the following, using your directory name for the WordPress core files:
    require('./wordpress/wp-blog-header.php');

    It think it would probably look something like this:

    require('./hollymedbery-wp/wp-blog-header.php');

    Wow. That’s a lot of muddy water. There’s three basic ways to run WordPress in your situation.

    The first is to install all of the files in the root directory, and have the WordPress urls point to root. All the files will be installed at //yourdomain.com/ and all of your urls will be //yourdomain.com/. You won’t be able to run any other site from root at the same time, and no sub-directory will appear in your addresses.

    The second is to install all of your files in a sub-directory. (which you have already done) All the files will be installed at //yourdomain.com/directory_name and all of your urls will be //yourdomain.com/directory_name . You can run another site in //yourdomain.com and have a WordPress site in //yourdomain.com/directory_name at the same time. All of your WordPress urls will have the sub-directory name in them.

    The third (what you have been trying to do, I believe) is to leave WordPress in the sub-directory, and make the site accessible to users from the root domain. This would mean that although the WordPress site is actually at //yourdomain.com/directory_name, your users can reach it by typing //yourdomain.com in the browser address bar. This also means that while you can access it from //yourdomain.com, the files are still being served from the sub-directory. That’s why the sub-directory still appears in the urls. If I am understanding things correctly, that is the part that seems to be causing you some distress. The bottom line is, I think that if WordPress is in a sub-directory, then that directory is going to appear in your urls even of you make it accessible from (serve it from) root. The trick to success now, might be to decide which one of those methods is going to be right for your situation. I'm dizzy just thinking about it! I don't think there is any way to actually remove the sub-directory from the urls if you use the "serve from root" method, but maybe someone else will pop in with a solution for that if there is one.

  14. deepbevel
    Member
    Posted 2 years ago #

    Wow, thanks for taking the time for that.
    You know I already have two wp sites in sub directories on another hosting account, but they are "add-on" domains, not the root domain. So, they don't show their folder path in the url. This is something I over looked in expecting the folder to not be included in the url when serving wp as a root domain from a sub directory.

    Still hoping there's a way to do it, but at least you helped clairify my questions about the codex instructions. I shall try again to serve the wp site as a root domain from a subdirectory. Last time I did it I was missing some css and my slidshow plugin wasn't loading properly. If I can get the site to work properly as the root, I shall then focus on the url issue.

    Thanks!

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.