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

Обновление форума с 2х на 4.х Блоги ЧПУ

Recommended Posts

Добрый день! Столкнулся с малой проблемой.

Обновил форум давно.... с блогами с 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/

 

Можно, как-то сделать переадресацию, старых ссылок на новые?

Share this post


Link to post

В \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'));
	}
}

  • Upvote 1

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