Answer the question
In order to leave comments, you need to log in
Nginx Rewrite not working, how to solve?
Hello. There is a php script at the root is the .htaccess file and in the /router folder is the .htaccess file
The one that lies at the root :
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^$ router/ [L]
RewriteRule (.*) router/$1 [L]
</IfModule>
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule .* index.php [L]
</IfModule>
serve<code></code>r {
listen 80 default_server;
listen [::]:80 default_server;
root /home/vadosiq/server/public_html;
index index.php index.phtml index.html index.htm;
server_name _;
location / {
rewrite ^$ router/ break;
rewrite ^(.*)$ router/$1 break;
try_files $uri $uri = 404;
}
location /router {
if (!-e $request_filename) {
rewrite ^router/(.*)$ router/index.php break;
}
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/var/run/php/php5.6-fpm.sock;
}
location ~ /\.ht {
deny all;
}
}
Answer the question
In order to leave comments, you need to log in
It's better to understand how to configure, read the documentation, understand what needs to be done, and write a config, rather than mindlessly using converters...
The equivalent of your .htaccess would look something like this:
location = / {
rewrite ^$ router/;
}
location / {
rewrite ^(.*)$ router/$1 break;
}
location /router {
try_files $uri $uri/ /router/index.php;
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question