WordPress.org

Ready to get started?Download WordPress

Forums

WP in subdirectory gives page not found error (2 posts)

  1. iveph
    Member
    Posted 2 years ago #

    Hi, I am having some strange things with the newly installed wp 3.2.1 in a subdirecoty of my domain. Following the codex, I moved the index.php and .htaccess to the root directory (public_html) and modified the index.php accordingly. Now, if I type in the url of my domain, the wp works just fine; however if I type in the subdirectory, such as mydomain.com/wp or mydomain.com/wp/index.php, it simply gives a 404 page not found error.

    I checked mysql database, the urlsite in the wp_option table showed "mydomain.com/wp" rather than "mydomain.com", I am wondering if this is right? If I change the urlsite to "mydomain.com" under phpmyadmin, the website just shows a text page as if there is no theme installed

    This is my .htaccess file under root directory

    # 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

    and this is the .htaccess file in the subdirectory

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /wp/
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /wp/index.php [L]
    </IfModule>
    
    # END WordPress

    I am new with WP, please help me. Thanks

  2. Ctrl-C
    Member
    Posted 2 years ago #

    You need to place all your files into subdirectory (even index.php and .htaccess).

Topic Closed

This topic has been closed to new replies.

About this Topic