Jump to content
Дизайн и модификация IPS Community IPBSkinsBETA
Search In
  • More options...
Find results that contain...
Find results in...
Sign in to follow this  
koskad

mod_rewrite под Nginx

Recommended Posts

Всех приветствую!

 

Перешел с Apache на FastCGI (Nginx + PHP-FPM)

Настроил ssl в конфиге nginx, подключил http2 и отключил в админцентре mod_rewrite.

В итоге, сайт получил ощутимый прирост скорости загрузки страниц.

Но появилась проблема проблема с ссылками.

Так как .htaccess теперь не задействован, то mod_rewrite не работает.

Ссылки с поисковых систем теперь ведут прямиком в ошибку 404 nginx.

Как сделать rewrite под ngnix?

Share this post


Link to post

Заменил

 

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/...

Share this post


Link to post

Проблема решена. Оказалось, нужно было в админцентре включить обратно настройку mod_rewrite.

Share this post


Link to post

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...