Атаман Posted September 20, 2018 Share Posted September 20, 2018 Добрый день! Столкнулся с малой проблемой.Обновил форум давно.... с блогами с 2.х на 4.х все хорошо, но не переадресовывает со старых адресов на новые. Старый адрес на запись блога: http://new.mybirds.ru/index.php?automodule=blog&blogid=744&showentry=8457Новый адрес на запись блога: https:// сайт/forums/blogs/entry/8457-transformatsii/ Старый адрес на весь блог: http:// сайт /index.php?automodule=blog&blogid=744&Новый адрес на весь блог: https:// сайт/forums/blogs/blog/744-rik-elena-dnevnik/ Можно, как-то сделать переадресацию, старых ссылок на новые? Link to comment Share on other sites More sharing options...
newbie Posted September 20, 2018 Share Posted September 20, 2018 В \applications\blog\Application.phpдобавить /** * Perform some legacy URL parameter conversions * * @return void */ public function convertLegacyParameters() { /* convert index.php?automodule=blog&blogid=744& */ if (isset(\IPS\Request::i()->automodule) and \IPS\Request::i()->automodule == 'blog') { if (isset(\IPS\Request::i()->blogid) and intval(\IPS\Request::i()->blogid) > 0) { try { $blog = \IPS\blog\Blog::loadAndCheckPerms(\IPS\Request::i()->blogid, 'read'); \IPS\Output::i()->redirect($blog->url()); } catch (\Exception $e){} } \IPS\Output::i()->redirect(\IPS\Http\Url::internal('app=blog&module=blogs&controller=browse', 'front', 'blogs')); } } 1 Link to comment Share on other sites More sharing options...
Атаман Posted September 20, 2018 Author Share Posted September 20, 2018 Спасибо ;) 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