Jump to content

Featured Replies

Posted

Здравствуйте, кто знает, напомните пожалуйста, как сделать реврайт в нжинксе, чтобы например страница site.ru/page/page2?id=3 открывалась по адресу site.ru/other/3

location /other/ {
rewrite ^/other/(.*)$ /page/page2?id=$1 last;
}

Не получается..

  • Author

Заработало всё же так, ошибка была в ссылке

location /other/ {
rewrite ^/other/(.*)$ /index.php?app=pages&page=news?id=$1 last;
}

Но срабатывает только вот так

site.ru/other/?id=1

А мне нужно, чтобы было так

site.ru/other/1

то есть спрятать ?id=

И чтоб страница site.ru/other/ открывалась как /index.php?app=pages&page=news (без гет запроса)

А то пишет, что ошибка

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Ответить в этой теме...

Последние посетители 0

  • No registered users viewing this page.