Hello,
I am working with a panel in which requires the pages to function
properly
from the .htaccess file. However, I am no longer using Apache and have
decided to do a Centmin Mod LEMP web stack to improve performance and
whatnot. Anyways, I used this online converter
htaccess to nginx converter and when I put the code it gave me into
my
vhost.conf file, I got an error (see below). The error occurs even when
I
place that code in my domain.com.conf file, vhost.conf file, or
nginx.conf
file. The URL types my panel uses are
http://domain.com/staff/core.staffDetails and it’s throwing a 404 error
simply because it’s not reading the .htaccess file since I’m using
Nginx.
The error I’m receiving:
–
[root@radio ~]# ngxrestart
nginx: [emerg] “location” directive is not allowed here in
/usr/local/nginx/conf/conf.d/virtual.conf:50
Again, that happens even when I try the other files listed above.
.htaccess code I need converted:
–
Options -Indexes
Various rewrite rules.
RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} !=/favicon.ico
RewriteRule ^(.)(.)(.)$ index.php?url=$1.$3 [L,QSA]
RewriteRule ^ajax$ _res/ajax.php [QSA]
#RewriteRule ^(.*)$ index.php?t=$1 [L,QSA]
I am using a Linux VPS running CentOS 6.5 if that information is needed.
Thank you!
Posted at Nginx Forum: