Welcome! Log In Create A New Profile

Advanced

Need help to convert htaccess to nginx

Posted by isara 
Need help to convert htaccess to nginx
November 27, 2012 09:46AM
Hey there,

I just came across Nginx, can someone help me to rewrite these rules to nginx ? Thanks in advance.


And here's my .htaccess content

=====================================================================
RewriteEngine on
Options -Indexes +FollowSymlinks
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([0-9]+)$ $1/ [R]
RewriteRule ^([0-9]+)/$ details.php?progid=$1 [L]
RewriteRule ^([0-9]+)/details(.*)\.html$ details.php?progid=$1 [L]
RewriteRule ^([0-9]+)/download(.*)\.html$ download.php?progid=$1 [L]
RewriteRule ^([0-9]+)/dl/(.*)$ dl.php?progid=$1 [L]
RewriteRule ^([0-9]+)/buy(.*)\.html$ buynow.php?progid=$1 [L]
RewriteRule ^([0-9]+)/reviews$ $1/reviews/ [R]
RewriteRule ^([0-9]+)/reviews/$ reviews.php?progid=$1 [L]
RewriteRule ^([0-9]+)/reviews/([0-9]+)\.html$ reviews.php?progid=$1&page=$2 [L]
RewriteRule ^([0-9]+)/screenshot(.*)\.html$ screenshot.php?progid=$1 [L]
RewriteRule ^([0-9]+)/author(.*)\.html$ author.php?progid=$1 [L]
RewriteRule ^alphabet-programs/letter-(.*)\.html$ alphabet.php?list=programs&letter=$1 [L]
RewriteRule ^alphabet-authors/letter-(.*)\.html$ alphabet.php?list=authors&letter=$1 [L]
RewriteRule ^featured$ featured/ [R]
RewriteRule ^featured/$ featured.php [L]
RewriteRule ^featured/([0-9]+)\.html$ featured.php?page=$1 [L]
RewriteRule ^featured/by-([A-Za-z]+)$ featured/by-$1/ [R]
RewriteRule ^featured/by-([A-Za-z]+)/$ featured.php?sort=$1 [L]
RewriteRule ^featured/by-([A-Za-z]+)/([0-9]+)\.html$ featured.php?sort=$1&page=$2 [L]
RewriteRule ^sitemap\.xml$ sitemap.php [L]


ErrorDocument 400 /error.php?400
ErrorDocument 401 /error.php?401
ErrorDocument 403 /error.php?403
ErrorDocument 404 /error.php?404
ErrorDocument 500 /error.php?500


<FilesMatch "\.(inc)$">
Order Allow,Deny
Deny from all
</FilesMatch>
=====================================================================
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 152
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