It's about 5 days I'm trying to launch my website without any success. The problem is I use apache on the local and my website works well in local, and my server uses nginx and I cannot use .htaccess conversion inside nginx configuration.
Here is a simplified of my website structure:
/mywebsite
/application
/files
file1.php
.htaccess
/public
/css
/js
.htaccess
See? I have two .htaccess
files. One is located on the root and another one is inside files
directory. It all works on the localhost, since I use apache on localhost. Now I need to make it working on the server which uses nginx.
I use this website to convert the content of htaccess files to nginx-configuration.
First of all, should I paste the result of conversion in what file? (where is nginx configuration file located? /etc/nginx/nginx.conf
?)
And how can I handle those two .htaccess
files? Should I make two nginx files too?
.htaccess
file in the root:
RewriteEngine on
Options -Indexes
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([\s\S]*)$ index.php?rt=$1 [L,B,QSA]
ErrorDocument 404 /error404.html
Options -Indexes
<Files *.php>
Order Deny,Allow
Deny from all
Allow from ::1
</Files>
<Files index.php>
Order Allow,Deny
Allow from all
</Files>
.htaccess
file which is inside files
directory:
<Files *.php>
Allow from all
</Files>