Moving Blog to Root – Problems with htaccess

Home Forums BulletProof Security Free Moving Blog to Root – Problems with htaccess

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
  • #6409
    Will Edwards

    Until now I have had my WP blog installed in a subdirectory, BPS also installed and everything was working fine. However, I wanted to move my blog to the root directory.

    To achieve this, I followed the instructions here …
    However, to make redirection work, I had to delete the .htaccess from the /blog directory.
    And it all went well.
    Internal and external links to /blog/topic all correctly redirect to /topic
    Now, of course I want BPS running. But my problems are:
    1. BPS says there is no .htaccess in the root i.e. it must still be looking in the blog directory
    2. If I create a new .htaccess with BPS, the redirection of /blog/topic to /topic stops working.
    Any help would be appreciated.
    Many thanks

    Will 🙂

    Will Edwards

    I have this issue sorted out now. This thread was useful …

    What I had to do was:
    1. Create the secure .htaccess file with BPS
    2. Unlock the .htaccess file – can be done within BPS
    3. Edit (again within the BPS Plugin) the .htaccess file removing all occurrences of /olddirectory
    4. Copy the new .htaccess created by BPS to the site root
    5. For some reason everytime I did this the copied file had the /olddirectory references so edited the copied file to remove

    With thanks for Admin for the above thread.
    All tested and all OK, everything working: redirects & BPS is happy too.

    Will 🙂

    AITpro Admin

    You would create the .htaccess file normally by activating BulletProof Modes. Then following the WordPress Codex on Giving WordPress Its Own Directory…
    “Copy (NOT MOVE!) the index.php and .htaccess files from the WordPress directory into the root directory of your site (Blog address). The .htaccess file is invisible, so you may have to set your FTP client to show hidden files. If you are not using pretty permalinks, then you may not have a .htaccess file.”

    What this means is that you will need to edit the the .htaccess file that you are copying from the /blog folder to the root folder and change the RewriteBase and RewriteRules in that .htaccess file.  Remove the /blog path anywhere you find it in the copy of the .htaccess file that you are going to copy into the root folder.


    RewriteBase /blog/ 
    will be... 
    RewriteBase / your root .htaccess file.
    RewriteRule . /blog/index.php [L] 
    will be... 
    RewriteRule . /index.php [L] your root .htaccess file
Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.