• mik.e245

    (@mike245)


    Hello,
    I have a WordPress site that is contained in the blog/ directory on my site.
    To make my blog display on the root of my site, I followed the steps to change the WordPress blog address. So now, when I go to my site root, I am presented with my blog.

    However, one flaw remains. I cannot access other files within my root directory; they result in a 404 not found error. For example, I have an image (1.png) in the root directory. I type https://example.com/1.png, which gives a 404.


    Site Structure:

    • Root
    • .htaccess
    • blog
    • blog files
    • index.php
    • 1.png

    What should I change in my .htaccess file?

    Thanks,
    Michael

Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter mik.e245

    (@mike245)

    Just in case, here’s what my .htaccess file looks like:

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

    …And I put some more files/folders on my site and found that I can access some, but not all of them. Strange…

    Robert Chapin

    (@miqrogroove)

    The RewriteBase value is incorrect for a root path.

    Thread Starter mik.e245

    (@mike245)

    What should I put for the Rewrite Base? The root directory (/)?
    I tried this and had the same problem.

    However, what is strange is that I added a couple more directories and files via FTP, and some of them are found by the web browser, some aren’t (resulting in a WordPress-styled 404 error).

    Thread Starter mik.e245

    (@mike245)

    Okay, I think it works now. There wasn’t really a concrete solution, I just played around with the .htaccess files on my site.

    Robert Chapin

    (@miqrogroove)

    I suspect the reason for moving index.php was to prevent circular references between the two .htaccess files. The file from above would have caused more problems along those lines. If it is any consolation, I think the “Giving WordPress it’s Own Directory” was poorly written, or not intended for this specific situation.

    I have the same problem with my site right now. I installed WordPress into a subdirectory /blog originally, then later decided to move it to root with the same instructions. My problem is when I type https://example.com/blog, I get a 404 not found page. I would like to redirect it to the root page, where the blog’s contents is shown.

    mik.e245, how did you change your .htaccess files that made the redirection work?

    Or does anyone else have a concrete solution?

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘WordPress Site Root Redirect Problem’ is closed to new replies.