0

I have wordpress installed on the server. I have also uploaded custom directory named himanshu on the server. and when i am trying to access the files in it or directly accessing the folder via url its showing 404 file not found error.

.htaccess is here.

RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

# BEGIN cPanel-generated php ini directives, do not edit
# Manual editing of this file may result in unexpected behavior.
# To make changes to this file, use the cPanel MultiPHP INI Editor (Home >> Software >> MultiPHP INI Editor)
# For more information, read our documentation (https://go.cpanel.net/EA4ModifyINI)
<IfModule php5_module>
   php_flag asp_tags Off
   php_flag display_errors Off
   php_value max_execution_time 120
   php_value max_input_time 120
   php_value max_input_vars 1000
   php_value memory_limit 1024M
   php_value post_max_size 50M
   php_value session.gc_maxlifetime 1440
   php_value session.save_path "/var/cpanel/php/sessions/ea-php54"
   php_value upload_max_filesize 50M
   php_flag zlib.output_compression On
</IfModule>
<IfModule lsapi_module>
   php_flag asp_tags Off
   php_flag display_errors Off
   php_value max_execution_time 120
   php_value max_input_time 120
   php_value max_input_vars 1000
   php_value memory_limit 1024M
   php_value post_max_size 50M
   php_value session.gc_maxlifetime 1440
   php_value session.save_path "/var/cpanel/php/sessions/ea-php54"
   php_value upload_max_filesize 50M
   php_flag zlib.output_compression On
</IfModule>
# END cPanel-generated php ini directives, do not edit

# php -- BEGIN cPanel-generated handler, do not edit
# Set the “ea-php54” package as the default “PHP” programming language.
<IfModule mime_module>
  AddHandler application/x-httpd-ea-php54 .php .php5 .phtml
</IfModule>
# php -- END cPanel-generated handler, do not edit
  • Have look at https://stackoverflow.com/questions/1848500/htaccess-mod-rewrite-how-to-exclude-directory-from-rewrite-rule OR https://wordpress.org/support/topic/exclude-folder-htaccess/ – Prasad Wargad Jan 14 '20 at 06:46

1 Answers1

0

Add below code before RewriteRule ^index\.php$ - [L]

# exclude file
RewriteCond %{REQUEST_URI} !^/file1\.html$

# exclude folders
RewriteCond %{REQUEST_URI}  !(folder1|folder2) [NC]

Note: Replace file1 and folder1, folder2

Olaf Dietsche
  • 72,253
  • 8
  • 102
  • 198