WordPress.org

Ready to get started?Download WordPress

Forums

301 Redirect Root to Subfolder - htaccess not working. (2 posts)

  1. Srivathsan G.K
    Member
    Posted 7 months ago #

    I just moved WP install from root directory to sub folder.

    hosted index.html simple website on the root. Sub folder has wordpress /blog.

    Now after moving wp to sub folder, the 301 redirects aren't working for the blog post that was hosted on the root directory.

    The exact same issue am facing has been blog posted here - http://john.do/301-sub-folder/

    The solution given here works fine. The only issue am facing is, in the htaccess file it redirects all the files other than index.html.

    so the images folder which serves index.html also redirects to /blog.

    By adding a line of code n htaccess file can make the images folder and other folders which serves index.html make it not redirect to /blog?

    help appreciated.

  2. Srivathsan G.K
    Member
    Posted 7 months ago #

    Options +FollowSymLinks
    RewriteEngine on
    RewriteCond %{REQUEST_URI} !^/$
    RewriteCond %{REQUEST_URI} !^/index.html$
    #Anything else you want to load directly above and below is for the blog and dynamic calls
    RewriteRule (.*) http://www.myai.org/blog/$1 [R=301,L]

    Adding this line

    RewriteCond %{REQUEST_URI} !^/images$

    after RewriteCond %{REQUEST_URI} !^/index.html$ will solve the issue?

Reply

You must log in to post.

About this Topic