WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Moved my wordpress to the root folder, now all the links on my theme don't work (9 posts)

  1. Whitegoodshelp
    Member
    Posted 6 years ago #

    I followed these instructions ( http://codex.wordpress.org/Giving_WordPress_Its_Own_Directory ) to move my blog index.php file to the root directory so that my Blog would be at http://www.mysite.co.uk instead of http://www.mysite.co.uk/wordpress

    Now all the links to categories, comments etc. (which are in my theme's sidebar.php file are still pointing to mysite.co.uk/wp-admin/post.php and mysite.co.uk/wp-admin/profile.php etc. instead of mysite.co.uk/wordpress/wp-admin/profile.php which is where all the files still reside.

    Is there a way to tell my theme (MW1.2) that all files are not in the root directory, but they are still in the wordpress directory as they always have been? It seems to be getting its directions from the settings/general section which I had to alter to

    WordPress address (URL) http://www.snappyname.co.uk/wordpress
    Blog address (URL) http://www.snappyname.co.uk/wordpress

    To

    WordPress address (URL) http://www.snappyname.co.uk/wordpress
    Blog address (URL) http://www.snappyname.co.uk

    many thanks

    Andy

  2. Whitegoodshelp
    Member
    Posted 6 years ago #

    I should add that all the links are broken even with the wordpress default theme selected.

    I'm wondering if this could be a new problem introduced by version 2.5?

    I've just experimented by adding another test post in case the problem was only affecting previous posts. I created a new test post but clicking on the header in WordPress tries to find it in http://www.snappyname.co.uk/test/ which results in "Not Found
    The requested document was not found on this server."

    All other files are of course still in the wordpress/ directory.

    I've followed the instructions exactly but they just don't work in version 2.5. Are these instructions appropriate to move the wordpress blog index.php to the root directory when the blog has previously been running in it's own wordpress/ directory?

  3. Roy
    Member
    Posted 6 years ago #

    Perhaps you need to change the WordPress address under "settings" (2.5) or "options" (2.x.x).

  4. Whitegoodshelp
    Member
    Posted 6 years ago #

    Thank you for your reply. I have followed the instructions exactly ( http://codex.wordpress.org/Giving_WordPress_Its_Own_Directory ) which contains the instruction to change the address on the settings as you describe.

    The instructions say to leave "WordPress address (URL)" as http://www.snappyname.co.uk/wordpress which I have done and to change "Blog address (URL)" to point to the root folder of my site - http://www.snappyname.co.uk

    I have also followed the instructions to edit the index.PHP file "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 has worked in the sense that navigating to my domain name now goes to my WordPress blog, and it has also worked in the sense that logging in to the control panel works. But, most of the links on my blog, going to previous posts, comments, add a comment, previous entries and so on are all broken becausethey do not point to the WordPress folder where all other files remain.

  5. Roy
    Member
    Posted 6 years ago #

    But if your blog is no longer in the "wordpress" folder, why would you leave that folder in the blog address? Have you tried what happens if you set both urls to the root? (Clear cache, etc. afterwards of course.)

  6. Whitegoodshelp
    Member
    Posted 6 years ago #

    The blog remains in the wordpress folder. Only the main index.php has been moved. The tutorial I quoted is supposed to show how to do this.

    The object is to keep all the wordpress files in a separate folder (wordpress) but to be able to access the blog from the root of your server. So instead of getting to the blog via http://www.examplesite.co.uk/wordpress you can get there from http://www.examplesite.co.uk

  7. Roy
    Member
    Posted 6 years ago #

    Ok, I misunderstood the topic of the thread then. I don't have such a construction myself, so I don't know what's wrong...

  8. Whitegoodshelp
    Member
    Posted 6 years ago #

    I have solved the problem

    It was caused because I didn't have a writable .htaccess file in the root folder. I have never had an .htaccess file in my blog so I dodn't realise the significance. It seems that no .htaccess file doesn't cause any problems as long as your index.php file is inside the wordpress folder. After moving it to the root the wordpress script seems to have needed to write something to this missing file to update all the links.

  9. jpxwordpress
    Member
    Posted 6 years ago #

    Hi I have an urgent problem. Apparently, after having done I think exactly as Washerhelp had done (previously having my blog located at MYSITE.COM/BLOG, and wanting to keep all of the original blog files and postings in the Blog folder, and just access them from my ROOT.com folder), my blog is now completely inaccessible.

    I first tried following the 'Giving WordPress its own directory' page instructions and changing the specs on the Options page to:
    WordPress address (URL): MYSITE.COM/BLOG and
    Blog address (URL): MYSITE.COM) and also editing the index.php file (in the root folder) to require('./wp-blog-header.php'); - [taking out the require('./BLOG/wp-blog-header.php'); Lastly, I copied and pasted the code that the Admin page told me to insert into the .htaccess file, and ftped them to the served. At first the blog WAS loading into the ROOT url address, but I still saw a lot of posts as '..../blog/post-name....' yet they all seem to have their URL name automatically change to '.......ROOT/post-name...', so after that, I went back into the Wp-Admin page, selected my site's ROOT URL for both

    WordPress address (URL): MYSITE.COM and
    Blog address (URL): MYSITE.COM), and then that's when the "barbecuing of my blog" began to occur.

    Please help - would be SO much appreciated, as neither I nor anyone else can access my site's blog at the moment or publish for it - :(

    Thank you so much in advance.....

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.