F
F
Fyodor Buzinov2015-01-08 13:37:58
Nginx
Fyodor Buzinov, 2015-01-08 13:37:58

How to write rewrite in nginx?

Welcome all!
There is such a link index.php/topic,8128.25.html, where 8128 is the id of the topic, and 25 is the 2nd page, 24 messages are shown on one page in the topic.
Tell me how can I get such a link /community/topic8128/page2/ ?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
E
Eugene, 2015-01-08
@Nc_Soft

Here we need calculations on perl

D
Dmitry Zhavoronkov, 2015-01-08
@Ascendant

If you need to make a permanent redirect, then try this:

location /index.php {
    rewrite ^/index\.php/topic,([0-9]+)\.([0-9])[0-9]+\.html$ /community/topic$1/page$2 permanent;
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question