• I just discovered that one of the first WP sites I did for a client (over a year ago) is all messed up, and each “fix” I’ve tried hasn’t worked. Looking for some guidance. Please excuse the length, but hopefully it will provide all the details for a quick reply.

    When I first installed WP on this client site, I installed it in a sub-folder /wp/ so the client’s existing static site could continue running while I was developing the new WP site.

    When the development was complete, instead of just deleting the static site and changing the site URL from domain.com/wp to domain.com like I SHOULD have, I actually went through the steps in the codex for MOVING a site on the same server. I copied all the folders and such to the root directory, (left copies in the /wp/ folder too), etc.

    Now, a year later, when I don’t really remember all the details of what I did, I attempted to install a plugin for the client. Long story short, it wouldn’t work. In the end, I discovered that is because somehow, SOME of the site is using the files in the root folder, and SOME of the site is accessing files in the /wp/ folder.

    The first thing I did to try to fix this is to change the WordPress URL to domain.com/wp but left the site URL at domain.com. Then I had to copy a bunch of images from the root uploads folder into the /wp/wp-content/uploads folder, etc. etc. I believe now everything that should be in the /wp/ folder and subdirectories is there, and the site is working, but when I attempted to delete all the WP files (EXCEPT .htaccess and index.php) from the root directory, my home page would not load. All other pages on the site did work though – just not the home page.

    I want to delete all the WP files from the root and only run off the /wp/ folder. Here are some things I think I need to address:

    The contents of my .htaccess file in the root directory are strange, I don’t remember why I did this but I think it’s wrong:

    ‘<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /wp/
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /wp/index.php [L]
    </IfModule>

    # 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 ‘

    I also think that my index.php file in the ROOT directory needs to change:
    ‘define(‘WP_USE_THEMES’, true);

    require(‘./wp-blog-header.php’);’

    My thinking is that needs to say ./wp/wp-blog-header.php; but then when I look at the contents of that file, I wonder if the wp-blog-header.php file in /wp/ will have to also change?

    Are there any other things I need to change that I’m not thinking of?

    Thanks in advance.

Viewing 3 replies - 1 through 3 (of 3 total)
  • OK, so…you want all the wp files to be in /wp

    but you want to run wp from the root/main domain.com url correct?

    First off, we can probably delete the .htaccess entirely. That will set you back to default permalinks, you can customize them later.

    Next, your index.php in root should point to

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

    the actual wp-blog-header file should not be altered

    and in your general settings,
    WORDPRESS url should point to the files
    domain.com/wp

    SITE address should point to where you run WP file
    domain.com

    backup/save the .htaccess just in case you do need it….

    Thread Starter the_webscaper

    (@the_webscaper)

    Cool -thanks. Pretty much what I was thinking, but wasn’t sure.

    To confirm we’re on the same page:

    I want to have the wordpress core files stored in the /wp/ directory (because when the site was running off the copy in the root, that’s when things weren’t working; I don’t really care where the files themselves exist, I just wanted to get things working right).

    I want the site to be viewed at https://www.domain.com — no pages showing in the url as https://www.domain.com/wp/file-name

    Have to run out to an appointment, but will make these changes later and give it a go. If you (or anyone else!) thinks of anything else, let me know. Thanks!

    right if you set it u8p as we’ve discussed

    Your site will run domain.com

    all links will be, domain.com./post

    BUT, your admin will be domain.com/wp/wp-admin

    Only the admin continues to have the /wp if your files are kept there

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Two copies of WP on my site – oops.’ is closed to new replies.