Nginx no file found but picking information from mysql












0















Hey i have problem i install script on xampp and nginx webservers.
On xampp pefrectly working on nginx works only homepage other links not working because nginx can't find file i get 404 error but links like /login /singup picking information from database mysql and file don't exist like login.php singup.php but nginx try search file and i get error 404 what need to do to fix it? in xampp i don't get that error



server {
listen 80;
listen 443 ssl http2;
server_name hiddenlink.com;

root /var/www/yt/ig;
index index.php;

location / {
autoindex on;
root /var/www/yt/ig;
index index.php;

}

error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /var/www/yt;
}
error_page 404 /404.html;
location = /404.html {
root /var/www/yt;
internal;
}

#location / {
#try_files $uri $uri/ /index.php?q=$uri$args;
#}

location ~ [^/].php(/|$) {
fastcgi_split_path_info ^(.+?.php)(/.*)$;
if (!-f $document_root$fastcgi_script_name) {
return 404;
}
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;
#fastcgi_connect_timeout 300s;
fastcgi_read_timeout 120s;
#fastcgi_send_timeout 300s;

}

location ~ /.ht {
deny all;
}


if ($http_user_agent ~ "libwww-perl") {
set $block_user_agents 1;
}

}


.htaccess script



RewriteEngine On

#RewriteCond %{HTTPS} off
#RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

#RewriteCond %{HTTP_HOST} !^www.
#RewriteRule .* http://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

Options +FollowSymLinks
Options -Indexes

RewriteCond %{SCRIPT_FILENAME} !-d
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteRule . index.php [L,QSA]



# Performace optimization

# BEGIN Compress text files
<ifModule mod_deflate.c>
AddOutputFilterByType DEFLATE text/html text/xml text/css text/plain
AddOutputFilterByType DEFLATE image/svg+xml application/xhtml+xml application/xml
AddOutputFilterByType DEFLATE application/rdf+xml application/rss+xml application/atom+xml
AddOutputFilterByType DEFLATE text/javascript application/javascript application/x-javascript application/json
AddOutputFilterByType DEFLATE application/x-font-ttf application/x-font-otf
AddOutputFilterByType DEFLATE font/truetype font/opentype
</ifModule>
# END Compress text files

# BEGIN Expire headers
<ifModule mod_expires.c>
ExpiresActive On
ExpiresDefault "access plus 5 seconds"
ExpiresByType image/x-icon "access plus 31536000 seconds"
ExpiresByType image/jpeg "access plus 31536000 seconds"
ExpiresByType image/png "access plus 31536000 seconds"
ExpiresByType image/gif "access plus 31536000 seconds"
ExpiresByType application/x-shockwave-flash "access plus 31536000 seconds"
ExpiresByType text/css "access plus 31536000 seconds"
ExpiresByType text/javascript "access plus 31536000 seconds"
ExpiresByType application/javascript "access plus 31536000 seconds"
ExpiresByType application/x-javascript "access plus 31536000 seconds"
</ifModule>
# END Expire headers

# BEGIN Cache-Control Headers
<ifModule mod_headers.c>
<filesMatch ".(ico|jpe?g|png|gif|swf)$">
Header set Cache-Control "public"
</filesMatch>
<filesMatch ".(css)$">
Header set Cache-Control "public"
</filesMatch>
<filesMatch ".(js)$">
Header set Cache-Control "private"
</filesMatch>
<filesMatch ".(x?html?|php)$">
Header set Cache-Control "private, must-revalidate"
</filesMatch>

<filesMatch ".(woff|woff2|ttf|otf|eot)$">
Header set Cache-Control "max-age=31536000 private, must-revalidate"
</filesMatch>
</ifModule>
# END Cache-Control Headers









share|improve this question

























  • Please rewrite your question properly, using punctuation and paragraphs. Currently, it's all just one single sentence and it's really hard to follow your question.

    – Magnus Eriksson
    Dec 28 '18 at 14:27













  • Maybe now better?

    – D.Lopas
    Dec 28 '18 at 14:31











  • I'm guessing you have a .htaccess file that does some rewrites? Nginx doesn't read/use .htaccess-files. If you have rules in it, then you need to convert those rules to nginx and add them to your nginx-config.

    – Magnus Eriksson
    Dec 28 '18 at 14:34











  • added htaccess script code it's can be for this i get error?

    – D.Lopas
    Dec 28 '18 at 14:37











  • That is the reason. XAMPP is using Apache web server, which uses the htaccess file.

    – Magnus Eriksson
    Dec 28 '18 at 14:39
















0















Hey i have problem i install script on xampp and nginx webservers.
On xampp pefrectly working on nginx works only homepage other links not working because nginx can't find file i get 404 error but links like /login /singup picking information from database mysql and file don't exist like login.php singup.php but nginx try search file and i get error 404 what need to do to fix it? in xampp i don't get that error



server {
listen 80;
listen 443 ssl http2;
server_name hiddenlink.com;

root /var/www/yt/ig;
index index.php;

location / {
autoindex on;
root /var/www/yt/ig;
index index.php;

}

error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /var/www/yt;
}
error_page 404 /404.html;
location = /404.html {
root /var/www/yt;
internal;
}

#location / {
#try_files $uri $uri/ /index.php?q=$uri$args;
#}

location ~ [^/].php(/|$) {
fastcgi_split_path_info ^(.+?.php)(/.*)$;
if (!-f $document_root$fastcgi_script_name) {
return 404;
}
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;
#fastcgi_connect_timeout 300s;
fastcgi_read_timeout 120s;
#fastcgi_send_timeout 300s;

}

location ~ /.ht {
deny all;
}


if ($http_user_agent ~ "libwww-perl") {
set $block_user_agents 1;
}

}


.htaccess script



RewriteEngine On

#RewriteCond %{HTTPS} off
#RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

#RewriteCond %{HTTP_HOST} !^www.
#RewriteRule .* http://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

Options +FollowSymLinks
Options -Indexes

RewriteCond %{SCRIPT_FILENAME} !-d
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteRule . index.php [L,QSA]



# Performace optimization

# BEGIN Compress text files
<ifModule mod_deflate.c>
AddOutputFilterByType DEFLATE text/html text/xml text/css text/plain
AddOutputFilterByType DEFLATE image/svg+xml application/xhtml+xml application/xml
AddOutputFilterByType DEFLATE application/rdf+xml application/rss+xml application/atom+xml
AddOutputFilterByType DEFLATE text/javascript application/javascript application/x-javascript application/json
AddOutputFilterByType DEFLATE application/x-font-ttf application/x-font-otf
AddOutputFilterByType DEFLATE font/truetype font/opentype
</ifModule>
# END Compress text files

# BEGIN Expire headers
<ifModule mod_expires.c>
ExpiresActive On
ExpiresDefault "access plus 5 seconds"
ExpiresByType image/x-icon "access plus 31536000 seconds"
ExpiresByType image/jpeg "access plus 31536000 seconds"
ExpiresByType image/png "access plus 31536000 seconds"
ExpiresByType image/gif "access plus 31536000 seconds"
ExpiresByType application/x-shockwave-flash "access plus 31536000 seconds"
ExpiresByType text/css "access plus 31536000 seconds"
ExpiresByType text/javascript "access plus 31536000 seconds"
ExpiresByType application/javascript "access plus 31536000 seconds"
ExpiresByType application/x-javascript "access plus 31536000 seconds"
</ifModule>
# END Expire headers

# BEGIN Cache-Control Headers
<ifModule mod_headers.c>
<filesMatch ".(ico|jpe?g|png|gif|swf)$">
Header set Cache-Control "public"
</filesMatch>
<filesMatch ".(css)$">
Header set Cache-Control "public"
</filesMatch>
<filesMatch ".(js)$">
Header set Cache-Control "private"
</filesMatch>
<filesMatch ".(x?html?|php)$">
Header set Cache-Control "private, must-revalidate"
</filesMatch>

<filesMatch ".(woff|woff2|ttf|otf|eot)$">
Header set Cache-Control "max-age=31536000 private, must-revalidate"
</filesMatch>
</ifModule>
# END Cache-Control Headers









share|improve this question

























  • Please rewrite your question properly, using punctuation and paragraphs. Currently, it's all just one single sentence and it's really hard to follow your question.

    – Magnus Eriksson
    Dec 28 '18 at 14:27













  • Maybe now better?

    – D.Lopas
    Dec 28 '18 at 14:31











  • I'm guessing you have a .htaccess file that does some rewrites? Nginx doesn't read/use .htaccess-files. If you have rules in it, then you need to convert those rules to nginx and add them to your nginx-config.

    – Magnus Eriksson
    Dec 28 '18 at 14:34











  • added htaccess script code it's can be for this i get error?

    – D.Lopas
    Dec 28 '18 at 14:37











  • That is the reason. XAMPP is using Apache web server, which uses the htaccess file.

    – Magnus Eriksson
    Dec 28 '18 at 14:39














0












0








0








Hey i have problem i install script on xampp and nginx webservers.
On xampp pefrectly working on nginx works only homepage other links not working because nginx can't find file i get 404 error but links like /login /singup picking information from database mysql and file don't exist like login.php singup.php but nginx try search file and i get error 404 what need to do to fix it? in xampp i don't get that error



server {
listen 80;
listen 443 ssl http2;
server_name hiddenlink.com;

root /var/www/yt/ig;
index index.php;

location / {
autoindex on;
root /var/www/yt/ig;
index index.php;

}

error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /var/www/yt;
}
error_page 404 /404.html;
location = /404.html {
root /var/www/yt;
internal;
}

#location / {
#try_files $uri $uri/ /index.php?q=$uri$args;
#}

location ~ [^/].php(/|$) {
fastcgi_split_path_info ^(.+?.php)(/.*)$;
if (!-f $document_root$fastcgi_script_name) {
return 404;
}
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;
#fastcgi_connect_timeout 300s;
fastcgi_read_timeout 120s;
#fastcgi_send_timeout 300s;

}

location ~ /.ht {
deny all;
}


if ($http_user_agent ~ "libwww-perl") {
set $block_user_agents 1;
}

}


.htaccess script



RewriteEngine On

#RewriteCond %{HTTPS} off
#RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

#RewriteCond %{HTTP_HOST} !^www.
#RewriteRule .* http://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

Options +FollowSymLinks
Options -Indexes

RewriteCond %{SCRIPT_FILENAME} !-d
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteRule . index.php [L,QSA]



# Performace optimization

# BEGIN Compress text files
<ifModule mod_deflate.c>
AddOutputFilterByType DEFLATE text/html text/xml text/css text/plain
AddOutputFilterByType DEFLATE image/svg+xml application/xhtml+xml application/xml
AddOutputFilterByType DEFLATE application/rdf+xml application/rss+xml application/atom+xml
AddOutputFilterByType DEFLATE text/javascript application/javascript application/x-javascript application/json
AddOutputFilterByType DEFLATE application/x-font-ttf application/x-font-otf
AddOutputFilterByType DEFLATE font/truetype font/opentype
</ifModule>
# END Compress text files

# BEGIN Expire headers
<ifModule mod_expires.c>
ExpiresActive On
ExpiresDefault "access plus 5 seconds"
ExpiresByType image/x-icon "access plus 31536000 seconds"
ExpiresByType image/jpeg "access plus 31536000 seconds"
ExpiresByType image/png "access plus 31536000 seconds"
ExpiresByType image/gif "access plus 31536000 seconds"
ExpiresByType application/x-shockwave-flash "access plus 31536000 seconds"
ExpiresByType text/css "access plus 31536000 seconds"
ExpiresByType text/javascript "access plus 31536000 seconds"
ExpiresByType application/javascript "access plus 31536000 seconds"
ExpiresByType application/x-javascript "access plus 31536000 seconds"
</ifModule>
# END Expire headers

# BEGIN Cache-Control Headers
<ifModule mod_headers.c>
<filesMatch ".(ico|jpe?g|png|gif|swf)$">
Header set Cache-Control "public"
</filesMatch>
<filesMatch ".(css)$">
Header set Cache-Control "public"
</filesMatch>
<filesMatch ".(js)$">
Header set Cache-Control "private"
</filesMatch>
<filesMatch ".(x?html?|php)$">
Header set Cache-Control "private, must-revalidate"
</filesMatch>

<filesMatch ".(woff|woff2|ttf|otf|eot)$">
Header set Cache-Control "max-age=31536000 private, must-revalidate"
</filesMatch>
</ifModule>
# END Cache-Control Headers









share|improve this question
















Hey i have problem i install script on xampp and nginx webservers.
On xampp pefrectly working on nginx works only homepage other links not working because nginx can't find file i get 404 error but links like /login /singup picking information from database mysql and file don't exist like login.php singup.php but nginx try search file and i get error 404 what need to do to fix it? in xampp i don't get that error



server {
listen 80;
listen 443 ssl http2;
server_name hiddenlink.com;

root /var/www/yt/ig;
index index.php;

location / {
autoindex on;
root /var/www/yt/ig;
index index.php;

}

error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /var/www/yt;
}
error_page 404 /404.html;
location = /404.html {
root /var/www/yt;
internal;
}

#location / {
#try_files $uri $uri/ /index.php?q=$uri$args;
#}

location ~ [^/].php(/|$) {
fastcgi_split_path_info ^(.+?.php)(/.*)$;
if (!-f $document_root$fastcgi_script_name) {
return 404;
}
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;
#fastcgi_connect_timeout 300s;
fastcgi_read_timeout 120s;
#fastcgi_send_timeout 300s;

}

location ~ /.ht {
deny all;
}


if ($http_user_agent ~ "libwww-perl") {
set $block_user_agents 1;
}

}


.htaccess script



RewriteEngine On

#RewriteCond %{HTTPS} off
#RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

#RewriteCond %{HTTP_HOST} !^www.
#RewriteRule .* http://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

Options +FollowSymLinks
Options -Indexes

RewriteCond %{SCRIPT_FILENAME} !-d
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteRule . index.php [L,QSA]



# Performace optimization

# BEGIN Compress text files
<ifModule mod_deflate.c>
AddOutputFilterByType DEFLATE text/html text/xml text/css text/plain
AddOutputFilterByType DEFLATE image/svg+xml application/xhtml+xml application/xml
AddOutputFilterByType DEFLATE application/rdf+xml application/rss+xml application/atom+xml
AddOutputFilterByType DEFLATE text/javascript application/javascript application/x-javascript application/json
AddOutputFilterByType DEFLATE application/x-font-ttf application/x-font-otf
AddOutputFilterByType DEFLATE font/truetype font/opentype
</ifModule>
# END Compress text files

# BEGIN Expire headers
<ifModule mod_expires.c>
ExpiresActive On
ExpiresDefault "access plus 5 seconds"
ExpiresByType image/x-icon "access plus 31536000 seconds"
ExpiresByType image/jpeg "access plus 31536000 seconds"
ExpiresByType image/png "access plus 31536000 seconds"
ExpiresByType image/gif "access plus 31536000 seconds"
ExpiresByType application/x-shockwave-flash "access plus 31536000 seconds"
ExpiresByType text/css "access plus 31536000 seconds"
ExpiresByType text/javascript "access plus 31536000 seconds"
ExpiresByType application/javascript "access plus 31536000 seconds"
ExpiresByType application/x-javascript "access plus 31536000 seconds"
</ifModule>
# END Expire headers

# BEGIN Cache-Control Headers
<ifModule mod_headers.c>
<filesMatch ".(ico|jpe?g|png|gif|swf)$">
Header set Cache-Control "public"
</filesMatch>
<filesMatch ".(css)$">
Header set Cache-Control "public"
</filesMatch>
<filesMatch ".(js)$">
Header set Cache-Control "private"
</filesMatch>
<filesMatch ".(x?html?|php)$">
Header set Cache-Control "private, must-revalidate"
</filesMatch>

<filesMatch ".(woff|woff2|ttf|otf|eot)$">
Header set Cache-Control "max-age=31536000 private, must-revalidate"
</filesMatch>
</ifModule>
# END Cache-Control Headers






php mysql nginx






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Dec 28 '18 at 14:36







D.Lopas

















asked Dec 28 '18 at 14:19









D.LopasD.Lopas

32




32













  • Please rewrite your question properly, using punctuation and paragraphs. Currently, it's all just one single sentence and it's really hard to follow your question.

    – Magnus Eriksson
    Dec 28 '18 at 14:27













  • Maybe now better?

    – D.Lopas
    Dec 28 '18 at 14:31











  • I'm guessing you have a .htaccess file that does some rewrites? Nginx doesn't read/use .htaccess-files. If you have rules in it, then you need to convert those rules to nginx and add them to your nginx-config.

    – Magnus Eriksson
    Dec 28 '18 at 14:34











  • added htaccess script code it's can be for this i get error?

    – D.Lopas
    Dec 28 '18 at 14:37











  • That is the reason. XAMPP is using Apache web server, which uses the htaccess file.

    – Magnus Eriksson
    Dec 28 '18 at 14:39



















  • Please rewrite your question properly, using punctuation and paragraphs. Currently, it's all just one single sentence and it's really hard to follow your question.

    – Magnus Eriksson
    Dec 28 '18 at 14:27













  • Maybe now better?

    – D.Lopas
    Dec 28 '18 at 14:31











  • I'm guessing you have a .htaccess file that does some rewrites? Nginx doesn't read/use .htaccess-files. If you have rules in it, then you need to convert those rules to nginx and add them to your nginx-config.

    – Magnus Eriksson
    Dec 28 '18 at 14:34











  • added htaccess script code it's can be for this i get error?

    – D.Lopas
    Dec 28 '18 at 14:37











  • That is the reason. XAMPP is using Apache web server, which uses the htaccess file.

    – Magnus Eriksson
    Dec 28 '18 at 14:39

















Please rewrite your question properly, using punctuation and paragraphs. Currently, it's all just one single sentence and it's really hard to follow your question.

– Magnus Eriksson
Dec 28 '18 at 14:27







Please rewrite your question properly, using punctuation and paragraphs. Currently, it's all just one single sentence and it's really hard to follow your question.

– Magnus Eriksson
Dec 28 '18 at 14:27















Maybe now better?

– D.Lopas
Dec 28 '18 at 14:31





Maybe now better?

– D.Lopas
Dec 28 '18 at 14:31













I'm guessing you have a .htaccess file that does some rewrites? Nginx doesn't read/use .htaccess-files. If you have rules in it, then you need to convert those rules to nginx and add them to your nginx-config.

– Magnus Eriksson
Dec 28 '18 at 14:34





I'm guessing you have a .htaccess file that does some rewrites? Nginx doesn't read/use .htaccess-files. If you have rules in it, then you need to convert those rules to nginx and add them to your nginx-config.

– Magnus Eriksson
Dec 28 '18 at 14:34













added htaccess script code it's can be for this i get error?

– D.Lopas
Dec 28 '18 at 14:37





added htaccess script code it's can be for this i get error?

– D.Lopas
Dec 28 '18 at 14:37













That is the reason. XAMPP is using Apache web server, which uses the htaccess file.

– Magnus Eriksson
Dec 28 '18 at 14:39





That is the reason. XAMPP is using Apache web server, which uses the htaccess file.

– Magnus Eriksson
Dec 28 '18 at 14:39












1 Answer
1






active

oldest

votes


















0














You have a rewrite rule in your htaccess that redirects all requests (that doesn't exist on the server) to your index.php file:



From your current htaccess:



RewriteCond %{SCRIPT_FILENAME} !-d  
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteRule . index.php [L,QSA]


Since nginx doesn't use htaccess files, you need to add the same rule to your nginx-server config.



This nginx-rule should do the same thing as the htaccess-rewrite:



location / {
try_files $uri $uri/ /index.php?$args;
}





share|improve this answer



















  • 1





    Thanks it's working !

    – D.Lopas
    Dec 28 '18 at 14:48











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53959960%2fnginx-no-file-found-but-picking-information-from-mysql%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









0














You have a rewrite rule in your htaccess that redirects all requests (that doesn't exist on the server) to your index.php file:



From your current htaccess:



RewriteCond %{SCRIPT_FILENAME} !-d  
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteRule . index.php [L,QSA]


Since nginx doesn't use htaccess files, you need to add the same rule to your nginx-server config.



This nginx-rule should do the same thing as the htaccess-rewrite:



location / {
try_files $uri $uri/ /index.php?$args;
}





share|improve this answer



















  • 1





    Thanks it's working !

    – D.Lopas
    Dec 28 '18 at 14:48
















0














You have a rewrite rule in your htaccess that redirects all requests (that doesn't exist on the server) to your index.php file:



From your current htaccess:



RewriteCond %{SCRIPT_FILENAME} !-d  
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteRule . index.php [L,QSA]


Since nginx doesn't use htaccess files, you need to add the same rule to your nginx-server config.



This nginx-rule should do the same thing as the htaccess-rewrite:



location / {
try_files $uri $uri/ /index.php?$args;
}





share|improve this answer



















  • 1





    Thanks it's working !

    – D.Lopas
    Dec 28 '18 at 14:48














0












0








0







You have a rewrite rule in your htaccess that redirects all requests (that doesn't exist on the server) to your index.php file:



From your current htaccess:



RewriteCond %{SCRIPT_FILENAME} !-d  
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteRule . index.php [L,QSA]


Since nginx doesn't use htaccess files, you need to add the same rule to your nginx-server config.



This nginx-rule should do the same thing as the htaccess-rewrite:



location / {
try_files $uri $uri/ /index.php?$args;
}





share|improve this answer













You have a rewrite rule in your htaccess that redirects all requests (that doesn't exist on the server) to your index.php file:



From your current htaccess:



RewriteCond %{SCRIPT_FILENAME} !-d  
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteRule . index.php [L,QSA]


Since nginx doesn't use htaccess files, you need to add the same rule to your nginx-server config.



This nginx-rule should do the same thing as the htaccess-rewrite:



location / {
try_files $uri $uri/ /index.php?$args;
}






share|improve this answer












share|improve this answer



share|improve this answer










answered Dec 28 '18 at 14:43









Magnus ErikssonMagnus Eriksson

7,12841227




7,12841227








  • 1





    Thanks it's working !

    – D.Lopas
    Dec 28 '18 at 14:48














  • 1





    Thanks it's working !

    – D.Lopas
    Dec 28 '18 at 14:48








1




1





Thanks it's working !

– D.Lopas
Dec 28 '18 at 14:48





Thanks it's working !

– D.Lopas
Dec 28 '18 at 14:48


















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53959960%2fnginx-no-file-found-but-picking-information-from-mysql%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Mossoró

Error while reading .h5 file using the rhdf5 package in R

Pushsharp Apns notification error: 'InvalidToken'