Quantcast
Channel: Nginx Forum - Other discussion
Viewing all articles
Browse latest Browse all 972

Convert Apache htaccess to Nginx

$
0
0
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.

Viewing all articles
Browse latest Browse all 972

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>