RewriteEngine on
RewriteCond %{HTTP_HOST} ^www\.(.*) [NC]
RewriteRule ^(.*)$ http://%1/$1 [R=301,L]
RewriteRule ^rss\.xml$ /data/rss.php [L]
RewriteRule ^sitemap\.xml$ /data/sitemap.php [L]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)?$ data/engine.php?a=$1 [QSA,NC,L]
server {
listen 80;
server_name www.site.ru;
return 301 http://site.ru$request_uri;
}
server {
listen 80;
server_name site.ru;
root /var/www/html;
rewrite ^/rss\.xml$ /data/rss.php;
rewrite ^/sitemap\.xml$ /data/sitemap.php;
location @handler {
rewrite ^/(.*)$ /data/engine.php?a=$1;
}
location / {
try_files $uri $uri/ @handler;
}
location ~ \.php$ {
try_files $uri =404;
# Тут нужно добавить свои параметры fastcgi
}
}