It’s me again I was trying to install siwapp on my webserver but I
couldn’t make it work with nginx, here is the .htaccess file content:
# If the file is NOT the index.php file
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !index.php
# Hide all PHP files so none can be accessed by HTTP
RewriteRule (.*)\.php$ index.php/$1
RewriteCond $1
!^(index.php|nhototamsu|assets|cache|xd_receiver.html|photo|ipanel|automap|xajax_js|files|robots.txt|favicon.ico|ione.ico|(.*).xml|ror.xml|tool|google6afb981101589049.html|googlec0d38cf2adbc25bc.html|widget|iradio_admin|services|wsdl)
RewriteRule ^(.*)$ index.php/$1 [QSA,L]
When I access
http://myurl.com/tin-tuc/tuyen-sinh/tu-van/2012/04/25757-phan-van-qua-giua-khoi-a1-va-khoi-a.html
,nginx could display the page correctly, it said: “404 Not Found” (new
URL:
http://myurl.com/tin-tuc/tuyen-sinh/tu-van/2012/04/25757-phan-van-qua-giua-khoi-a1-va-khoi-a.html)
Posted at Nginx Forum:
You have not provided anything like sufficient information about your
configuration or the steps you’ve take to debug this.
Please read this in your mother tongue, apply its lessons, and
people may be able to help you:
http://www.catb.org/~esr/faqs/smart-questions.html#translations
HTH,
Jonathan
Jonathan M.
Oxford, London, UK
http://www.jpluscplusm.com/contact.html
I want convert htaccess to nginx, .htaccess file content:
If the file is NOT the index.php file
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !index.php
Hide all PHP files so none can be accessed by HTTP
RewriteRule (.*).php$ index.php/$1
RewriteCond $1
!^(index.php|nhototamsu|assets|cache|xd_receiver.html|photo|ipanel|automap|xajax_js|files|robots.txt|favicon.ico|ione.ico|(.*).xml|ror.xml|tool|google6afb981101589049.html|googlec0d38cf2adbc25bc.html|widget|iradio_admin|services|wsdl)
RewriteRule ^(.*)$ index.php/$1 [QSA,L]
I convert to nginx:
if ($request_filename !~ “index.php”) {
rewrite /(.).php$ /index.php/$1;
}
if ($request_uri !~
"^(index.php|nhototamsu|assets|cache|xd_receiver.html|photo|ipanel|automap|xajax_js|files|robots.txt|favicon.ico|ione.ico|(.).xml|ror.xml|tool|google6afb981101589049.html|googlec0d38cf2adbc25bc.html|widget|iradio_admin|services|wsdl)")
{
rewrite ^/(.*)$ /index.php/$1 last;
}
and nginx.conf file content:
worker_processes 4;
error_log logs/error.log debug;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
include /etc/nginx/conf.d/*;
sendfile on;
server_tokens off;
keepalive_timeout 15;
proxy_buffering off;
client_body_buffer_size 128K;
client_header_buffer_size 1k;
client_max_body_size 20m;
large_client_header_buffers 2 1k;
client_body_timeout 10;
client_header_timeout 10;
send_timeout 10;
gzip on;
gzip_comp_level 2;
gzip_min_length 1000;
gzip_proxied expired no-cache no-store private auth;
gzip_types text/plain application/xml;
gzip_disable "MSIE [1-6]\.";
server {
listen 80;
server_name ione.net;
root /www/ione/virtual;
if ($request_filename !~ “index.php”) {
rewrite /(.).php$ /index.php/$1;
}
if ($request_uri !~
"^(index.php|nhototamsu|assets|cache|xd_receiver.html|photo|ipanel|automap|xajax_js|files|robots.txt|favicon.ico|ione.ico|(.).xml|ror.xml|tool|google6afb981101589049.html|googlec0d38cf2adbc25bc.html|widget|iradio_admin|services|wsdl)")
{
rewrite ^/(.)$ /index.php/$1 last;
}
location / {
index index.php index.html index.htm;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
location ~
“.(js|ico|gif|jpg|png|css|html|htm|swf|htc|xml|bmp|cur)$” {
add_header Pragma “public-static”;
add_header Cache-Control “public-static”;
expires 3M;
access_log off;
log_not_found off;
}
location ~* .php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME
$document_root$fastcgi_script_name;
include fastcgi_params;
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
}
location ~ /. {
access_log off;
log_not_found off;
deny all;
}
}
}
Posted at Nginx Forum: