Question : force .htaccess on folder in site

I want to secure a specific folder on a domain.

the .htacess already has some info in there so when i add the generic force it "kinda" works. It will redirect to
https://exampledomain.com/fnova//home/purelife/public_html/fnova

below is .htaccess, you will see how it was and what i added.

What do i need to change so it switches to secure properly ?

Thanks




Code Snippet:
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
#dnwr_host htdocs.fn iz.ostrov.net
 
# deny access to all php files except index.php and ioncube helpers


deny from all

 

allow from all

 

allow from all


 

    Options FollowSymLinks
    RewriteEngine On
    RewriteRule .* - [E=MOD_R:1]
   RewriteRule ([^\?]+\.html)$ index.php?RequestPath=$1 [L,NC,QSA]
 

 

DirectoryIndex index.php

 
I have tried adding this
RewriteCond %{SERVER_PORT} 80 
RewriteCond %{REQUEST_URI} fnova 
RewriteRule ^(.*)$ https://www.purelifemarketing.com/fnova/$1 [R,L]

Answer : force .htaccess on folder in site

May be a trailing slash problem and a known bug within mod_rewrite, see below.
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
# deny access to all php files except index.php and ioncube helpers
 
<FilesMatch "\.php$">
deny from all
</FilesMatch>
 
<FilesMatch "index\.php$">
allow from all
</FilesMatch>
 
<FilesMatch "^ioncube">
allow from all
</FilesMatch>
 
Options FollowSymLinks
RewriteEngine On
 
# fix the trailing slash
RewriteRule ^(fnova)$ https://www.purelifemarketing.com/$1/ [R=301,L]
 
# redirect
RewriteCond %{HTTPS} =off
RewriteRule ^(fnova/.*) https://www.purelifemarketing.com/$1 [R,L]
 
RewriteRule ([^\?]+\.html)$ index.php?RequestPath=$1 [L,NC,QSA,E=MOD_R:1]
 
DirectoryIndex index.php
 
 
Random Solutions  
 
programming4us programming4us