Subdirectory installation of BPS

Home Forums BulletProof Security Free Subdirectory installation of BPS

Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • #6397
    PT
    Participant

    I’m having an a big issue with my site installed in a subdirectory, the BP doesn’t pickup my .htaccess in the root folder (one level above the installation dir) but instead it make another .htaccess inside the subdirectory that it assumed to be the root folder. What can i do to fix this?

    #6398
    AITpro Admin
    Keymaster

    Each website has its own separate .htaccess files.  When you click the Activate buttons the correct/valid Master .htaccess files for that site are created.

    http://forum.ait-pro.com/forums/topic/read-me-first-free/

    #6402
    PT
    Participant

    I have already done that like i said, but it created a .htaccess in the installed sub directory rather than the root directory, i.e. /home/mysite/public_html/mywp but what i want is the htaccess in the root like /home/mysite/public_html/.  I also have changed the upload folder to outside the installed directory so it is better to have .htaccess file in the root. The problem with BP is assumed the root directory is www.mysite.com/mywp and ignore the top document root directory which is /home/mysite/public_html/.

    #6403
    AITpro Admin
    Keymaster

    BPS looks at the folder where WordPress is installed and generates an .htaccess file in that website’s root folder.  BPS uses the WordPress Constant ABSPATH to do this.

    If your site is installed in a folder called /mywp and you activate BulletProof Modes then BPS will create an .htaccess file in the /mywp folder because that is what is supposed to happen.

    If you have a GWIOD website then you need to manually copy your /mywp folder .htaccess file to your /public_html folder.

    NOTE:  you will need to change the RewriteBase and RewriteRules for that .htaccess file.  Remove the /mywp path anywhere you find it in the copy of the .htaccess file that you are going to put in the /public_html folder.

    http://codex.wordpress.org/Giving_WordPress_Its_Own_Directory

    If you are trying to do something else then you need to tell me all the specific details about what you are trying to do.

    Example:  I have an HTML website in the /public_html folder and a WordPress site installed in this folder / mywp.

    I want to add an .htaccess file for my HTML website too.

    http://forum.ait-pro.com/forums/topic/bps-html-htaccess-file-for-html-websites-or-subfolders/

    If you have 2 WordPress websites – 1 installed in the /public_html folder and another in the /mywp folder then you would install BPS on both sites and click the activate BulletProof Modes buttons on both sites.

    If none of these scenarios is what you want to do then you will need to fully explain what you are trying to do.  I am guessing at this point because you have not told me exactly what you are trying to do.

    #6490
    PT
    Participant

    Thank you so much for the great response. Yes, basically i have my site installed as GWIOD.  I know i can copy and paste information from the BP .htaccess to the root .htaccess but won’t that affect the rewrite codes that created for the root of GWIOD and didn’t include the actual sub directory name? that would make the rewrite codes no longer working, would it?

    #6493
    AITpro Admin
    Keymaster

    Yes, you will have to modify / edit the .htaccess file you copy from the WordPress installation folder before putting it in the website root folder.

    NOTE:  you will need to change the RewriteBase and RewriteRules for that .htaccess file.  Remove the /mywp path anywhere you find it in the copy of the .htaccess file that you are going to put in the /public_html folder.

    Example:

    RewriteBase /mywp/ would need to be changed to RewriteBase / anywhere that you see RewriteBase in your .htaccess file that you will be adding to your website root folder..

    RewriteRule . /mywp/index.php [L] would need to be changed to RewriteRule . /index.php [L] in your .htaccess file that you will be adding to your website root folder.

     

    #6494
    AITpro Admin
    Keymaster

    At some point in a future version of BPS we will add an additional option for GWIOD sites that will create 2 .htaccess files – 1 for the WordPress installation folder and 1 for the website root folder.

    #6504
    PT
    Participant

    I just wanted to make sure i get this right, for example, this section of codes:

    RewriteEngine On
    RewriteBase /mywp/
    RewriteRule ^wp-admin/includes/ - [F,L]
    RewriteRule !^wp-includes/ - [S=3]
    RewriteRule ^wp-includes/[^/]+\.php$ - [F,L]
    RewriteRule ^wp-includes/js/tinymce/langs/.+\.php - [F,L]
    RewriteRule ^wp-includes/theme-compat/ - [F,L]

    If i change RewriteBase /mywp/ to RewriteBase / then the directory wp-admin/includes/ etc. actually do not exist at the link mysite.com/wp-admin/includes/ because it actually at mysite.com/mywp/wp-admin/includes/

    So i want to make sure that it is correct to remove the /mywp from the above codes as well as these below?

    # Adminer MySQL management tool data populate
    RewriteCond %{REQUEST_URI} ^/mywp/wp-content/plugins/adminer/ [NC]
    RewriteRule . - [S=12]
    # Comment Spam Pack MU Plugin - CAPTCHA images not displaying
    RewriteCond %{REQUEST_URI} ^/mywp/wp-content/mu-plugins/custom-anti-spam/ [NC]
    RewriteRule . - [S=11]
    # Peters Custom Anti-Spam display CAPTCHA Image
    RewriteCond %{REQUEST_URI} ^/mywp/wp-content/plugins/peters-custom-anti-spam-image/ [NC]
    RewriteRule . - [S=10]
    # Status Updater plugin fb connect
    RewriteCond %{REQUEST_URI} ^/mywp/wp-content/plugins/fb-status-updater/ [NC]
    RewriteRule . - [S=9]
    # Stream Video Player - Adding FLV Videos Blocked
    RewriteCond %{REQUEST_URI} ^/mywp/wp-content/plugins/stream-video-player/ [NC]
    RewriteRule . - [S=8]
    # XCloner 404 or 403 error when updating settings
    RewriteCond %{REQUEST_URI} ^/mywp/wp-content/plugins/xcloner-backup-and-restore/ [NC]
    RewriteRule . - [S=7]
    # BuddyPress Logout Redirect
    RewriteCond %{QUERY_STRING} action=logout&redirect_to=http%3A%2F%2F(.*) [NC]
    RewriteRule . - [S=6]
    # redirect_to=
    RewriteCond %{QUERY_STRING} redirect_to=(.*) [NC]
    RewriteRule . - [S=5]
    # Login Plugins Password Reset And Redirect 1
    RewriteCond %{QUERY_STRING} action=resetpass&key=(.*) [NC]
    RewriteRule . - [S=4]
    # Login Plugins Password Reset And Redirect 2
    RewriteCond %{QUERY_STRING} action=rp&key=(.*) [NC]
    RewriteRule . - [S=3]
    #6505
    AITpro Admin
    Keymaster

    You can either choose to ignore all this code or you can delete it since all of these sections of code are ONLY valid in your actual WordPress installation folder /mywp.  In other words, leaving this code or deleting this code does not matter either way.

    Probably best just to delete it since it will not do anything in your website root folder.

    #6508
    PT
    Participant

    What if instead of copying all the codes to my root htaccess, I just leave the BP htaccess in the /mywp folder as it is? will it work that way or will break my site? I just wanted to make sure i do this right so i won’t mess anything up. Thanks

    #6509
    AITpro Admin
    Keymaster

    You MUST HAVE 2 separate .htaccess files for a GWIOD website.  This is documented in the WordPress Codex for Giving WordPress Its Own Directory websites.  You are not modifying the existing .htaccess file in the /mywp folder in any way.  You  are ONLY modifying the new .htaccess file that you need to add to your website root folder.

    This is a very simple thing to do and would be pretty difficult to mess up since it is such a simple thing to do.  Just download the .htaccess file in the /mywp folder and make the edits I have told you to make and delete the code in your previous post that will have not effect in the website root folder.

    Example:

    RewriteBase /mywp/ would need to be changed to RewriteBase / anywhere that you see RewriteBase in your .htaccess file that you will be adding to your website root folder..

    RewriteRule . /mywp/index.php [L] would need to be changed to RewriteRule . /index.php [L] in your .htaccess file that you will be adding to your website root folder.

    #6516
    PT
    Participant

    I’ve made the changes you suggested and it’s working great. I actually don’t have an htaccess in the subdirectory because i have a root htaccess so it apply to all sub directories, i didn’t think its necessary to have another htaccess inside the mywp dir since it would just be redundant, if that’s not the case, please tell me what i should have in the htaccess inside the mywp dir. I really appreciated your quick replies 🙂

    #6517
    AITpro Admin
    Keymaster

    It is actually better to have an .htaccess file in your website root folder and your /mywp folder where WordPress is actually installed.  This allows you to have full control of your actual WordPress site’s security.  In general, you always want to compartmentalize security to individual folders to allow you flexibility / better control of each folder’s security rules.

    If you have used [obsolete-removed] then you do not need to do anything to your site’s .htaccess file, which is the .htaccess file located in /mywp.  The website root .htaccess file is really just there to rewrite the URL from /mywp to just / and does not really serve any other any purpose when you have an .htaccess file in your /mywp folder like you should have already.

Viewing 13 posts - 1 through 13 (of 13 total)
  • You must be logged in to reply to this topic.