Answer the question
In order to leave comments, you need to log in
How to make friends with nginx with .htaccess without using convert rewrite rules services?
Good day guys!!!
I'll get straight to the point. Let's say the anilcetin.com or winginx.com conversion services work amazingly (I don't want you to send me there), but the exhaust from them is too big and the code in nginx becomes simply huge. Who faced knows what I'm talking about. I wish the code was smaller.
With the following configurations, only the main one works for me, even when clicking on the links, the main one is still displayed. Maybe you can fix something so that footcloths from anilcetin.com or winginx.com are not inserted?
site.com
server {
listen 80;
root /var/www/html;
index index.php index.html index.htm;
server_name site.com;
error_page 404 /404.html;
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
location / {
# try_files $uri $uri/ =404;
try_files $uri $uri/ /index.php?q=$uri&$args;
}
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
# Cache Static Files For As Long As Possible
location ~*
\.(ogg|ogv|svg|svgz|eot|otf|woff|mp4|ttf|css|rss|atom|js|jpg|jpeg|gif|png|ico|zip|tgz|gz|rar|bz2|doc|xls|exe|ppt|tar|mid|midi|wav|bmp|rtf)$
{
access_log off;
log_not_found off;
expires max;
}
# Security Settings For Better Privacy Deny Hidden Files
location ~ /\. {
deny all;
access_log off;
log_not_found off;
}
}
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule ^play/(.*)-(.*).html$ play.php?slug=$1&id=$2
RewriteRule ^page/(.*)-(.*).html$ page.php?slug=$1&id=$2
RewriteRule ^category/(.*)/$ category.php?name=$1
RewriteRule ^category/(.*)$ category.php?name=$1
RewriteRule ^user/(.*)/$ profile.php?name=$1
RewriteRule ^user/(.*)$ profile.php?name=$1
RewriteRule ^game/(.*)/(.*)/$ game.php?do=$1&id=$2
RewriteRule ^game/(.*)/(.*)$ game.php?do=$1&id=$2
RewriteRule ^game/(.*)/$ game.php?do=$1
RewriteRule ^game/(.*)$ game.php?do=$1
RewriteRule ^panel/(.*)/(.*)/(.*)/$ panel.php?page=$1&type=$2&id=$3
RewriteRule ^panel/(.*)/(.*)/(.*)$ panel.php?page=$1&type=$2&id=$3
RewriteRule ^panel/(.*)/(.*)/$ panel.php?page=$1&type=$2
RewriteRule ^panel/(.*)/(.*)$ panel.php?page=$1&type=$2
RewriteRule ^login/(.*)/(.*)/$ login.php?type=$1&code=$2
RewriteRule ^login/(.*)/(.*)$ login.php?type=$1&code=$2
RewriteRule ^login/(.*)/$ system/external/OAuth/login.php?app=$1
RewriteRule ^login/(.*)$ system/external/OAuth/login.php?app=$1
RewriteRule ^embed/game/(.*)/$ api.php?type=game_embed&id=$1
RewriteRule ^data/user/(.*)/$ api.php?type=user_data&id=$1
RewriteRule ^embed/game/(.*)$ api.php?type=game_embed&id=$1
RewriteRule ^api/user/(.*)$ api.php?type=user_data&id=$1
RewriteRule ^gamefeed/(.*)$ api.php?type=game_feed&$1
RewriteRule ^gamefeed/$ api.php?type=game_feed
RewriteRule ^gamefeed$ api.php?type=game_feed
RewriteRule ^language/(.*)/$ language.php?code=$1
RewriteRule ^language/(.*)$ language.php?code=$1
RewriteRule ^forgot/(.*)/(.*)/(.*)/$ forgot.php?do=$1&forgotcode=$2&email=$3
RewriteRule ^forgot/(.*)/(.*)/(.*)$ forgot.php?do=$1&forgotcode=$2&email=$3
RewriteRule ^arcanox/(.*)/(.*)/$ arcanox.php?type=$1&password=$2
RewriteRule ^arcanox/(.*)/(.*)$ arcanox.php?type=$1&password=$2
RewriteRule ^warning/(.*)/$ error.php?type=$1
RewriteRule ^warning/(.*)$ error.php?type=$1
RewriteRule ^search/(.*)/$ search.php?s=$1
RewriteRule ^search/(.*)$ search.php?s=$1
RewriteRule ^register/(.*)$ register.php$1
RewriteRule ^system/language.js$ system/external/language.php
RewriteRule ^system/captcha.png$ system/external/captcha.php
RewriteRule ^warning/$ error.php
RewriteRule ^warning$ error.php
RewriteRule ^pending$ pending.php
RewriteRule ^panel$ panel.php
RewriteRule ^favorites$ favorites.php
RewriteRule ^settings$ settings.php
RewriteRule ^profile$ profile.php
RewriteRule ^leaderboard$ leaderboard.php
RewriteRule ^login$ login.php
RewriteRule ^forgot$ forgot.php
RewriteRule ^register$ register.php
RewriteRule ^logout$ logout.php
</IfModule>
Options -Indexes
IndexIgnore *
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question