Welcome! Log In Create A New Profile

Advanced

Convert Apache htaccess to Nginx

Posted by 3245 
Convert Apache htaccess to Nginx
December 01, 2016 02:35PM
When i moved from Apache to NGINX webserver in DrectAdmin, my site show "404 Not Found" in Read more content, like this: http://datagozar.net/news/79946

My Original Htaccess is below:

RewriteEngine on
RewriteRule ^category/(.*)/(.*)$ category.php?id=$1&slug=$2
RewriteRule ^source/(.*)/(.*)$ source.php?id=$1&slug=$2
RewriteRule ^news/(.*)/?$ news.php?id=$1&slug=$2
RewriteRule ^page/(.*)/(.*)$ page.php?id=$1&slug=$2
RewriteRule ^search/(.*)$ search.php?q=$1
RewriteRule ^not-found$ notfound.php
RewriteRule ^rss.xml$ rss.php
RewriteRule ^lasttagmap.xml$ lasttagmap.php
RewriteRule ^randtagmap.xml$ randtagmap.php
RewriteRule ^sitemap-(.*).xml$ sitemap.php?id=$1
RewriteRule ^categories-sitemap.xml$ categories-sitemap.php
Options +FollowSymLinks


i used http://winginx.com/htaccess and code finally is below, but still same Error

location /category {
rewrite ^/category/(.*)/(.*)$ /category.php?id=$1&slug=$2;
}
location /source {
rewrite ^/source/(.*)/(.*)$ /source.php?id=$1&slug=$2;
}
location /news {
rewrite ^/news/(.*)/?$ /news.php?id=$1&slug=$2;
}
location /page {
rewrite ^/page/(.*)/(.*)$ /page.php?id=$1&slug=$2;
}
location /search {
rewrite ^/search/(.*)$ /search.php?q=$1;
}
location /not {
rewrite ^/not-found$ /notfound.php;
}
location = /rss.xml {
rewrite ^(.*)$ /rss.php;
}
location = /lasttagmap.xml {
rewrite ^(.*)$ /lasttagmap.php;
}
location = /randtagmap.xml {
rewrite ^(.*)$ /randtagmap.php;
}
location /sitemap {
rewrite ^/sitemap-(.*).xml$ /sitemap.php?id=$1;
}
location /categories {
rewrite ^/categories-sitemap.xml$ /categories-sitemap.php;
}


what is issue you think?

thanks.
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 153
Record Number of Users: 8 on December 15, 2016
Record Number of Guests: 386 on August 02, 2016
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready