koskad Posted December 25, 2017 Share Posted December 25, 2017 Всех приветствую! Перешел с Apache на FastCGI (Nginx + PHP-FPM)Настроил ssl в конфиге nginx, подключил http2 и отключил в админцентре mod_rewrite.В итоге, сайт получил ощутимый прирост скорости загрузки страниц.Но появилась проблема проблема с ссылками.Так как .htaccess теперь не задействован, то mod_rewrite не работает.Ссылки с поисковых систем теперь ведут прямиком в ошибку 404 nginx.Как сделать rewrite под ngnix? Link to comment Share on other sites More sharing options...
newbie Posted December 25, 2017 Share Posted December 25, 2017 FastCGI (Nginx + PHP-FPM) 1 Link to comment Share on other sites More sharing options...
koskad Posted December 25, 2017 Author Share Posted December 25, 2017 Заменил location / { location ~ [^/]\.ph(p\d*|tml)$ { try_files /does_not_exists @php; } } На location / { try_files $uri $uri/ /index.php; location ~ [^/]\.ph(p\d*|tml)$ { try_files /does_not_exists @php; } } Результат тот же, ссылки имеют такой вид https://mydomen.ru/index.php?/forums/... Link to comment Share on other sites More sharing options...
koskad Posted December 25, 2017 Author Share Posted December 25, 2017 Проблема решена. Оказалось, нужно было в админцентре включить обратно настройку mod_rewrite. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now