Welcome! Log In Create A New Profile

Advanced

.htaccess to Nginx for specific script/folder?

Posted by realdannys 
.htaccess to Nginx for specific script/folder?
February 26, 2013 01:50PM
I've installed a script in a sub folder which relies on .htaccess rewrite rules - if you visit the script once install properly it redirects you a /login page which actually doesn't exist on the server. However this is all on Apache. I want to know how to convert the below .htaccess rules to nginx but also not affect our website in the root directory.

The .htaccess reads…

Options +FollowSymLinks
IndexIgnore */*
RewriteEngine on

# if a directory or a file exists, use it directly
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

# otherwise forward it to index.php
RewriteRule . index.php
The script is in a sub folder

/clp2/
So I assume if I make any redirect location rules it would need to specify the subfolder? As this .htaccess file is obviously folder specific and not web specific.

The full server path to the script is

/var/www/vhosts/i-16852366/clp2
Any input welcome, I assume this is quite easy if you know what you're doing - I tried an nginx re-writer but its not working and its obviously not being specific to the folder I need it doing the rewrite rule on, so I need some guidance there too.
Re: .htaccess to Nginx for specific script/folder?
February 26, 2013 07:07PM
IS anyone alive on the forums?
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 106
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready