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
    Posts
  • #6409
    Will Edwards
    Participant

    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 …

    http://compass-design.co.uk/2012/05/10/moving-wordpress-from-a-subdirectory-to-the-root-directory-in-five-minutes/
    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 ­čÖé

    #6411
    Will Edwards
    Participant

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

    http://forum.ait-pro.com/forums/topic/installation-of-bp-for-site-installed-in-subdirectory/

    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.

    Cheers,
    Will ­čÖé

    #6413
    AITpro Admin
    Keymaster

    You would create the .htaccess file normally by activating BulletProof Modes. Then following the WordPress Codex on Giving WordPress Its Own Directory…

    http://codex.wordpress.org/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.

    Examples:

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