Перейти к содержанию

[IP.Content] Помогите правильно перенести сайт


Kinkl

Рекомендуемые сообщения

Здравствуйте!

У меня возникла проблема, необходима помощь знающих людей.

В общем, суть такова: я задумал сделать сайт полностью средствами IPS. Для этого установил и настроил IP.Content.

Теперь собственно проблема: не могу сделать так, чтобы при переходе по www.site.ru открывался IP.Content, а при заходе на www.site.ru/forum - соответственно форум.

Получилось сделать IP.Content главным только при переходе по www.site.ru/forum.

Теперь по технической части: на хосте форум сейчас расположен по пути /forum/ (повторюсь, все идеально работает при таком раскладе), но, мне нужно, чтобы Ip.Content открывался при заходе на основной домен www.site.ru, простой перенос файлов форума в корень хоста ничего не дает, даже ничего не открывается.

Я так понимаю нужно правильно отредактировать файл /admin/applications/forums/extensions/furlTemplates.php, но как это сделать для www.site.ru я не знаю, в интернете нашел лишь информацию для того случая, когда форум находится именно в папке /forum/

Вот исходный код этого файла:


/**
* <pre>
* Invision Power Services
* IP.Board v3.3.1
* Sets up SEO templates
* Last Updated: $Date: 2011-08-02 15:53:39 -0400 (Tue, 02 Aug 2011) $
* </pre>
*
* @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license __www.invisionpower.com/community/board/license.html
* @package IP.Board
* @subpackage Forums
* @link __www.invisionpower.com
* @since 20th February 2002
* @version $Rev: 9351 $
*
*/

if ( ! defined( 'IN_IPB' ) )
{
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
exit();
}

/**
* SEO templates
*
* 'allowRedirect' is a flag to tell IP.Board whether to check the incoming link and if not formatted correctly, redirect the correct one
*
* OUT FORMAT REGEX:
* First array element is a regex to run to see if we've a match for the URL
* The second array element is the template to use the results of the parenthesis capture
*
* Special variable #{__title__} is replaced with the $title data passed to output->formatUrl( $url, $title)
*
* IMPORTANT: Remember that when these regex are used, the output has not been fully parsed so you will get:
* showuser={$data['member_id']} NOT showuser=1 so do not try and match numerics only!
*
* IN FORMAT REGEX
*
* This allows the registry to piece back together a URL based on the template regex
* So, for example: "/user/(d+?)/", 'matches' => array( array( 'showuser' => '$1' ) )tells IP.Board to populate 'showuser' with the result
* of the parenthesis capture #1
*/
$_SEOTEMPLATES = array(

'showannouncement' => array( 'app' => 'forums',
'allowRedirect' => 1,
'out' => array( '#showannouncement=(.+?)((?:&|&amp;)f=(.+?))?(&|$)#i', 'forum-$3/announcement-$1-#{__title__}/$4' ),
'in' => array( 'regex' => '#/forum-(d+?)?/announcement-(d+?)-#i',
'matches' => array( array( 'showannouncement', '$2' ), array( 'f', '$1' ) ) ) ),

'showforum' => array( 'app' => 'forums',
'allowRedirect' => 1,
'out' => array( '#showforum=(.+?)(&|$)#i', 'forum/$1-#{__title__}/$2' ),
'in' => array( 'regex' => '#^/forum/(d+?)-#i',
'matches' => array( array( 'showforum', '$1' ) ) ) ),

'showtopicunread'=> array( 'app' => 'forums',
'allowRedirect' => 1,
'out' => array( '#showtopic=(.+?)(?:&|&amp;)view=getnewpost(&|$)#i', 'topic/$1-#{__title__}/unread/$2' ),
'in' => array( 'regex' => '#^/topic/(d+?)-([^/]+?)/unread(/|$)#i',
'matches' => array( array( 'showtopic', '$1' ),
array( 'view', 'getnewpost' ) ) ) ),

'showtopicnextunread'=> array( 'app' => 'forums',
'allowRedirect' => 1,
'out' => array( '#showtopic=(.+?)(?:&|&amp;)view=getnextunread(&|$)#i', 'topic/$1-#{__title__}/nextunread/$2' ),
'in' => array( 'regex' => '#^/topic/(d+?)-([^/]+?)/nextunread(/|$)#i',
'matches' => array( array( 'showtopic', '$1' ),
array( 'view', 'getnextunread' ) ) ) ),

'showtopic' => array( 'app' => 'forums',
'allowRedirect' => 1,
'out' => array( '#showtopic=(.+?)(&|$)#i', 'topic/$1-#{__title__}/$2' ),
'in' => array( 'regex' => '#^/topic/(d+?)-#i',
'matches' => array( array( 'showtopic', '$1' ) ) ) ),

'acteqst' => array( 'app' => 'forums',
'allowRedirect' => 1,
'out' => array( '#act=ST(.*?)&t=(.+?)(&|$)#i', 'topic/$2-#{__title__}/$3' ),
'in' => array( 'regex' => '#^notavalidrequest$#i',
'matches' => array( array( 'showtopic', '0' ) ) ) ),

'act=idx' => array( 'app' => 'forums',
'allowRedirect' => 0,
'out' => array( '#act=idx(&|$)#i', 'index$1' ),
'in' => array( 'regex' => '#^/index(/|$|?)#i',
'matches' => array( array( 'act', 'idx' ) ) ) ),
);[/PHP]
<?php

[/spoiler]

[b]А это измененный, который работает по переходу по [i]www.site.ru/forum[/i][/b]

[spoiler]

[PHP]<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.3.1
* Sets up SEO templates
* Last Updated: $Date: 2011-08-02 15:53:39 -0400 (Tue, 02 Aug 2011) $
* </pre>
*
* @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license __www.invisionpower.com/community/board/license.html
* @package IP.Board
* @subpackage Forums
* @link __www.invisionpower.com
* @since 20th February 2002
* @version $Rev: 9351 $
*
*/

if ( ! defined( 'IN_IPB' ) )
{
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
exit();
}

/**
* SEO templates
*
* 'allowRedirect' is a flag to tell IP.Board whether to check the incoming link and if not formatted correctly, redirect the correct one
*
* OUT FORMAT REGEX:
* First array element is a regex to run to see if we've a match for the URL
* The second array element is the template to use the results of the parenthesis capture
*
* Special variable #{__title__} is replaced with the $title data passed to output->formatUrl( $url, $title)
*
* IMPORTANT: Remember that when these regex are used, the output has not been fully parsed so you will get:
* showuser={$data['member_id']} NOT showuser=1 so do not try and match numerics only!
*
* IN FORMAT REGEX
*
* This allows the registry to piece back together a URL based on the template regex
* So, for example: "/user/(d+?)/", 'matches' => array( array( 'showuser' => '$1' ) )tells IP.Board to populate 'showuser' with the result
* of the parenthesis capture #1
*/
$_SEOTEMPLATES = array(

'showannouncement' => array( 'app' => 'forums',
'allowRedirect' => 1,
'out' => array( '#showannouncement=(.+?)((?:&|&amp;)f=(.+?))?(&|$)#i', 'forums/forum-$3/announcement-$1-#{__title__}/$4' ),
'in' => array( 'regex' => '#/forums/forum-(d+?)?/announcement-(d+?)-#i',
'matches' => array( array( 'showannouncement', '$2' ), array( 'f', '$1' ) ) ) ),

'showforum' => array( 'app' => 'forums',
'allowRedirect' => 1,
'out' => array( '#showforum=(.+?)(&|$)#i', 'forums/forum/$1-#{__title__}/$2' ),
'in' => array( 'regex' => '#^/forums/forum/(d+?)-#i',
'matches' => array( array( 'showforum', '$1' ) ) ) ),

'showtopicunread'=> array( 'app' => 'forums',
'allowRedirect' => 1,
'out' => array( '#showtopic=(.+?)(?:&|&amp;)view=getnewpost(&|$)#i', 'forums/topic/$1-#{__title__}/unread/$2' ),
'in' => array( 'regex' => '#^/forums/topic/(d+?)-([^/]+?)/unread(/|$)#i',
'matches' => array( array( 'showtopic', '$1' ),
array( 'view', 'getnewpost' ) ) ) ),

'showtopicnextunread'=> array( 'app' => 'forums',
'allowRedirect' => 1,
'out' => array( '#showtopic=(.+?)(?:&|&amp;)view=getnextunread(&|$)#i', 'forums/topic/$1-#{__title__}/nextunread/$2' ),
'in' => array( 'regex' => '#^/forums/topic/(d+?)-([^/]+?)/nextunread(/|$)#i',
'matches' => array( array( 'showtopic', '$1' ),
array( 'view', 'getnextunread' ) ) ) ),

'showtopic' => array( 'app' => 'forums',
'allowRedirect' => 1,
'out' => array( '#showtopic=(.+?)(&|$)#i', 'forums/topic/$1-#{__title__}/$2' ),
'in' => array( 'regex' => '#^/forums/topic/(d+?)-#i',
'matches' => array( array( 'showtopic', '$1' ) ) ) ),

'acteqst' => array( 'app' => 'forums',
'allowRedirect' => 1,
'out' => array( '#act=ST(.*?)&t=(.+?)(&|$)#i', 'forums/topic/$2-#{__title__}/$3' ),
'in' => array( 'regex' => '#^notavalidrequest$#i',
'matches' => array( array( 'showtopic', '0' ) ) ) ),

'act=idx' => array( 'app' => 'forums',
'allowRedirect' => 0,
'out' => array( '#act=idx(&|$)#i', 'forums/$1' ),
'in' => array( 'regex' => '#^/forums(/|$|?)#i',
'matches' => array( array( 'act', 'idx' ) ) ) ),
);
[/PHP]

[/spoiler]

Там по сути лишь добавилось к некоторым путям /forums/, и все...

Ссылка на комментарий
Поделиться на другие сайты

egorea1999, нет, редирект вообще не вариант... Можно сделать обычными средствами, но я пока не могу понять как. Сейчас менял еще в conf_global путь к форуму на www.site.ru/forum, опять же сайт не открывался (404), НО в админку почему-то я попадал

Ссылка на комментарий
Поделиться на другие сайты

Короче говоря, вам нужно чтобы по

http://dark.dk/ открывался IP.Content, а по http://dark.dk/forum - соответственно форум?

И файл который вы правили за это не отвечает, это SEO редиректы.

Ссылка на комментарий
Поделиться на другие сайты

_Dark_, да, именно это и нужно!

Ссылка на комментарий
Поделиться на другие сайты

Через .htaccess можно сделать вместе с mod_rewrit'ом.

Я только не знаю как.

Ссылка на комментарий
Поделиться на другие сайты

Делаю как написано тут, но ни главная, ни форум не открываются. Остальное (файлы, галерея, чат и т.д) открывается нормально

Ссылка на комментарий
Поделиться на другие сайты

Можно сделать редирект средствами мета тегов в хедере индексной страницы!

Залить её на mysite.ru, файлик будет делать редирект в папку forums, где и будет ip.content. Другого выхода не вижу, кроме как переместить всё в корень..

Ссылка на комментарий
Поделиться на другие сайты

Присоединяйтесь к обсуждению

Вы можете написать сейчас и зарегистрироваться позже. Если у вас есть аккаунт, авторизуйтесь, чтобы опубликовать от имени своего аккаунта.
Примечание: Ваш пост будет проверен модератором, прежде чем станет видимым.

Гость
Ответить в этой теме...

×   Вставлено с форматированием.   Вставить как обычный текст

  Разрешено использовать не более 75 эмодзи.

×   Ваша ссылка была автоматически встроена.   Отображать как обычную ссылку

×   Ваш предыдущий контент был восстановлен.   Очистить редактор

×   Вы не можете вставлять изображения напрямую. Загружайте или вставляйте изображения по ссылке.

  • Последние посетители   0 пользователей онлайн

    • Ни одного зарегистрированного пользователя не просматривает данную страницу
×
×
  • Создать...