• Resolved seedplanta

    (@seedplanta)


    Went thru your help and such and by the way love the plugin, but while active I noticed that my other sites (HTML not WP) are showing Forbidden when going to https://example.com the site info is there i.e I can goto specific pages including index.htm and all is well and looks right but the example.com doesnt load the index.htm page instead I get a Forbidden error. I have found when I return to my bakup .htaccess file it works but when I activate BPS I get the error. So I know the problem lies in the .htaccess file but I am not techy enuff to know what to do. Is it safe for me to copy the txt from the bakup .htaccess file to the BPS created file or does this defeat the purpose of BPS security? PLEASE HELP! I perceive its something simple but my knowledge has no clue. Thanks.

    https://www.ads-software.com/plugins/bulletproof-security/

Viewing 15 replies - 16 through 30 (of 59 total)
  • Plugin Author AITpro

    (@aitpro)

    Or if there is still some sort of problem then change your code to this code:

    it does the exact same thing except that it checks the HOST

    RewriteCond %{HTTP_HOST} sitename.com [NC]
    RewriteRule ^([^/]+)/([^/]+)/([^/.]+)$ /$1/$2/$3/ [R=301,L]
    Plugin Author AITpro

    (@aitpro)

    Or…

    RewriteCond %{HTTP_HOST} sitename.com [NC]
    RewriteRule ^/([0-9]{4})/([0-9]{2})/(.*)$ https://bellydanceoz.com/$3
    Thea

    (@dorothy1508)

    Sorry, AIT, I know I am not the best technically but I have just gone to my cpanel and found and opened each of the htaccess files. They’re there. I knew they were there already because I’ve added Analytics code and some eBay coding to them in the past. I’ll try your new coding though and thanks for being so generous with your assistance.

    Plugin Author AITpro

    (@aitpro)

    here is a normal example scenario.
    You have 3 WordPress sites and each of them has their own .htaccess files. each of those WordPress sites will only follow the rules in its own .htaccess file and WordPress will handle permalink rewriting internally on each of those sites. So something unusual is occuring here to create this issue/problem.

    Example:
    If all 3 example WordPress sites are using the standard WordPress .htaccess code then each site will ONLY follow the rules in its own .htaccess file and WordPress will do the permalink rewriting internally with php code. WordPress handles permalink rewriting internally and NOT in the standard .htaccess file/code that WordPress generates.

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

    If you have added your RedirectMatch code outside of the WordPress Rewrite Loop then it might be possible that this is affecting other sites, but I have never seen or heard of the problem you are describing before when using the standard WordPress .htaccess code/file.

    For whatever reason this problem is occurring on your main site your .htaccess file should look like this on the bellydanceoz.com site to prevent this problem:

    NOTE: What concerns me about doing this is that WordPress already handles permalink rewriting internally and NOT in the standard WordPress .htaccess code/file. So this may have an undesirable effect since this is very non-standard and is normally already handled by WordPress internally and would not need to be done at all.

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{HTTP_HOST} ^bellydanceoz\.com [NC]
    RewriteRule ^/([0-9]{4})/([0-9]{2})/(.*)$ https://bellydanceoz.com/$3
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    # END WordPress
    Plugin Author AITpro

    (@aitpro)

    In the end what I expect will be the best solution will be to create individual RedirectMatch rules and NOT to use Regular Expressions code to try and handle all pattern matches with that one rule.

    Thread Starter seedplanta

    (@seedplanta)

    Ok so I just was able to try what you posted but I’m getting 500 errors. if the folder name includes .com does the rules change on how to show Rewrite Rules?

    Plugin Author AITpro

    (@aitpro)

    Ok so I just was able to try what you posted but I’m getting 500 errors.

    What exactly did you use/do?

    Thread Starter seedplanta

    (@seedplanta)

    followed instructions for .htaccess file

    # This file is created for HTML websites and HTML websites that are in a root website folder
    # if you HTML website is in a subfolder then you will need to change the RewriteBase and RewriteRules
    # to match that subfolder name/path
    # Example: If an HTML website is in a subfolder called /example-html-website then the RewriteBase and
    # RewriteRule in this file need to be changed using these examples below:
    # RewriteBase /example-html-website/
    # RewriteRule ^/example-html-website/index\.htm$ - [L]
    # RewriteRule . /example-html-website/index.htm [L]
    
    RewriteEngine On
    RewriteBase /foldername\.com/
    RewriteRule ^foldername\.com/index\.htm$ - [L]
    RewriteRule . /foldername\.com/index.htm [L]

    as I stated the folder name contains is example.com and from my original .htaccess file concluded to show .com portion as shown above. I hope this makes sense. Did I code it right or not?

    Plugin Author AITpro

    (@aitpro)

    If you have a website/domain installed/added in a folder named:

    /example.com

    Then this is a separate domain/website. This is a root website and not a subfolder website so the RewriteBase and RewriteRule is:

    RewriteBase /
    RewriteRule . /index.htm [L]

    If you had another site installed/added in a subfolder named:

    /example.com/subfolder

    Then this is a subfolder site so the RewriteBase and RewriteRule is:

    RewriteBase /subfolder/
    RewriteRule . /subfolder/index.htm [L]
    Plugin Author AITpro

    (@aitpro)

    I will add these examples on the HTML htaccess files page in the Forum since I can see how the help info I added is not clear about the differences between what is a root website/domain and what is a subfolder website.

    Maybe tomorrow I will bring my similar questions over here to help keep all of this in one place!

    Thread Starter seedplanta

    (@seedplanta)

    Ok tried what I think I understand and still get 500 error, does the rewrite htaccess file go in Root or .com folder? Do I still use entire. htm. htaccess file or not. Htaccess file Originally in.com folder had rules in it

    RewriteEngine on
    RewriteCond %{HTTP_HOST} ^sitename\.com$ [OR]
    RewriteCond %{HTTP_HOST} ^www\.sitename\.com$

    I guess I an getting confused which code to use and where. Sorry.

    Plugin Author AITpro

    (@aitpro)

    The term “root” is getting you a bit confused so let me give you some examples of root websites.

    Your Document Root folder for your website would be this if your particular Host uses “/public_html/”. Some host’s use “/html/”, some use “/htdocs/” etc etc etc:

    /public_html/ is shortened to just / to signify the root folder for your Hosting account.

    All of these websites are considered root websites.

    / – a website is installed here in the root / of the hosting account
    /WebsiteA.com
    /WebsiteB.com
    /WebsiteC.com

    From everything you have explained so far you have several websites and they are all root websites. The only thing you are doing is what is explained in this link: https://forum.ait-pro.com/forums/topic/bps-html-htaccess-file-for-html-websites-or-subfolders/

    The other comments in this thread are answers to Thea’s questions.

    Plugin Author AITpro

    (@aitpro)

    Or you can always just do this for your HTML websites. Create a RewriteEngine Off .htaccess file and put it in each of your HTML website’s folders.

    https://forum.ait-pro.com/forums/topic/rewriteengine-off-htaccess-file/

    Thread Starter seedplanta

    (@seedplanta)

    Yeah I did that and, it gives me a forbidden-error. Do I need to mike changes to the htm.htaccess file?

Viewing 15 replies - 16 through 30 (of 59 total)
  • The topic ‘BPS causes my HTML sites to show Forbiddn’ is closed to new replies.