convert .htaccess for nginx
tophi
nginx-forum at nginx.us
Sun Feb 6 22:10:37 MSK 2011
Hello,
I have tryed to read about rewrite rules but I'm not able to handle
this, Have already tryed online convert for .htaccess to nginx but when
I restart my ngnix server I get error message
[code]
[emerg]: invalid parameter "/[L]" in /usr/local/nginx/conf/rrulesvco:24
configuration file /usr/local/nginx/conf/nginx.conf test failed
[/code]
/usr/local/nginx/conf/rrulesvco is include in my nginx.conf file under
my "location ~ \.php$ { "
My old .htaccess looks like so:
[code]
RewriteCond %{QUERY_STRING} mosConfig_[a-zA-Z_]{1,21}(=|\%3D) [OR]
RewriteCond %{QUERY_STRING} base64_encode.*\(.*\) [OR]
RewriteCond %{QUERY_STRING} (\<|%3C).*script.*(\>|%3E) [NC,OR]
RewriteCond %{QUERY_STRING} GLOBALS(=|\[|\%[0-9A-Z]{0,2}) [OR]
RewriteCond %{QUERY_STRING} _REQUEST(=|\[|\%[0-9A-Z]{0,2})
RewriteRule ^([^.]*)/?$ index.php [L]
RewriteRule ^videos/(.*)/(.*)/(.*)/(.*)/(.*)
videos.php?cat=$1&sort=$3&time=$4&page=$5&seo_cat_name=$2 [L]
RewriteRule ^videos videos.php?%{QUERY_STRING} [L]
RewriteRule ^video/(.*)/(.*) watch_video.php?v=$1&%{QUERY_STRING} [L]
RewriteRule ^channels/(.*)/(.*)/(.*)/(.*)/(.*)
channels.php?cat=$1&sort=$3&time=$4&page=$5&seo_cat_name=$2 [L]
RewriteRule ^channels channels.php [L]
RewriteRule
^group/([a-zA-Z0-9].+) view_group.php?url=$1&%{QUERY_STRING} [L]
RewriteRule
^view_topic/([a-zA-Z0-9].+)_tid_([0-9]+) view_topic.php?tid=$2&%{QUERY_STRING}
[L]
RewriteRule ^groups/(.*)/(.*)/(.*)/(.*)/(.*)
groups.php?cat=$1&sort=$3&time=$4&page=$5&seo_cat_name=$2 [L]
RewriteRule ^groups groups.php [L]
RewriteRule ^create_group create_group.php [L]
RewriteRule ^sitemap.xml$ sitemap.php
RewriteRule ^signup signup.php
RewriteRule ^rss$ rss.php [nc]
RewriteRule ^rss/([a-zA-Z0-9].+)$
rss.php?mode=$1&%{QUERY_STRING} [nc]
RewriteRule ^desktop desktop.php [L]
[/code]
Thanks
Posted at Nginx Forum: http://forum.nginx.org/read.php?2,172639,172639#msg-172639
More information about the nginx
mailing list