• I am planning on creating a wordpress sub-site within my main website to use as a news page. I have done this on another site with no problems, but that was a few years ago and I haven’t updated that site’s WP.

    I just installed wordpress in a sub-folder of my main (non-WP) site. It says installation was successful, but every time I try to log in to the dashboard, wordpress goes outside of its sub-folder, to the index.php of my main site. It also does this when I try to go to the main page of the wordpress site.

    I even tried temporarily deleting my main site’s index.php to see what wordpress would do, and it gave me a “can’t find the index.php” error message, even though the wordpress subfolder has its index.php file, and so does the wp-admin folder.

    just to be clear, here is how the directories are set up:

    Main Site folder
    —index.php
    —wordpress folder
    ——index.php (wordpress is ignoring this file and loading the
    ——main site’s index.php instead).
    ——wp-admin folder
    ———index.php (wordpress is ignoring this file and loading the
    ———main site’s index.php instead).

    Any idea how I can get wordpress to stay within it’s directories instead of loading the main site’s index.php?

Viewing 8 replies - 1 through 8 (of 8 total)
  • what did you put as the site URL?

    Thread Starter jeffersonpowers

    (@jeffersonpowers)

    I never got a chance to put in the site URL – wp-admin/install.php doesn’t ask for it, and I can even get to the dashboard.

    does the .htaccess file in your main directory ignore subfolders? if you haven’t customized it in any way, try deleting it and letting your WordPress on your main site generate it again.

    Thread Starter jeffersonpowers

    (@jeffersonpowers)

    The main site is not a WP site. It’s a PHP site that someone else did originally. I’m working on the site now and unfortunately i don’t know much about PHP so my additions to the site have been a bit patchwork.

    Removing the .htaccess file fixed the wordpress problems, but now none of the main site’s links work.

    Is there a way to modify the .htaccess file so it won’t interfere with WordPress?

    what’s in the .htaccess file?

    Thread Starter jeffersonpowers

    (@jeffersonpowers)

    the .htaccess file contains the following:

    RewriteEngine on
    RewriteCond %{HTTP_HOST} !^www\.
    RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]
    RewriteCond %{REQUEST_URI} ^/[^\.]+[^/]$
    RewriteRule ^(.*)$ http://%{HTTP_HOST}/$1/ [R=301,L]
    RewriteRule ^([^/\.]+)/?$ /index.php?link=$1 [L]
    RewriteRule ^([^/\.]+)/([^/\.]+)/?$ /index.php?link=$1&page=$2 [L]
    RewriteRule ^([^/\.]+)/([^/\.]+)/([^/\.]+)/?$ /index.php?link=$1&page=$2&align=$3 [L]

    Without it, none of the main site’s pages will load other than the front page.

    your rewrite rules are sending all requests to your main site’s index.php file.

    try adding

    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d

    with the other rewrite conditions. This should get it to ignore requests for real files and directories.

    Thread Starter jeffersonpowers

    (@jeffersonpowers)

    Thank you so much for all your help, but unfortunately adding that code didn’t do anything.

    I think I have this client convinced to let me rebuild his entire site in WP, so this issue shouldn’t be a problem (although if anyone comes up with a solution I’d love to hear it!).

    Thanks again for your time and advice.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘WordPress going to wrong index.php’ is closed to new replies.