htaccess for separate folder without disturbing homepage

I have wordpress installed in rootfolder in http://example.com . I have created new folder named world http://example.com/world , I need htaccess to work on that particular folder alone , Is it possible?

My htaccess I need to use for folder world is given below. I added this in rootfolder htaccess and I got internal server error and hence I don’t want to disturb the root folder.

Read More
RewriteEngine On
RewriteBase /

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule (.*)(/?)$ / [QSA,NC,L]

My root folder htaccess

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteCond %{SERVER_PORT} ^443$
RewriteRule ^(.*)$ http://%{HTTP_HOST}/$1 [R=301,L]
RewriteRule ^index.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress

Related posts

Leave a Reply

1 comment

  1. Replace your DOCUMENT_ROOT/.htaccess with this code:

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    
    Options +FollowSymLinks -MultiViews
    RewriteEngine On
    RewriteBase /
    
    # don't do anything for /world folder
    RewriteRule ^world/ - [L,NC]
    
    RewriteCond %{SERVER_PORT} ^443$
    RewriteRule ^(.*)$ http://%{HTTP_HOST}/$1 [R=301,L]
    
    RewriteRule ^index.php$ - [L]
    
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    
    </IfModule>
    # END WordPress
    

    Replace your DOCUMENT_ROOT/world/.htaccess with this code:

    Options +FollowSymLinks -MultiViews
    RewriteEngine On
    RewriteBase /world/
    
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-l
    RewriteRule ^ index.php [L]