AMILO 36 Posted October 12, 2014 Author Report Share Posted October 12, 2014 @BayBackOff, На этой странице обнаружена циклическая переадресация. Quote Link to post Share on other sites
Indigo88 30 Posted October 12, 2014 Report Share Posted October 12, 2014 @BayBackOff, Эта ЦМС-ка сделал всем вызов AMILO 1 Quote Link to post Share on other sites
AMILO 36 Posted October 12, 2014 Author Report Share Posted October 12, 2014 @Indigo88, это точно... Вот не пойму почему оно забрасывает в циклическую переадресацию? Quote Link to post Share on other sites
Indigo88 30 Posted October 12, 2014 Report Share Posted October 12, 2014 @AMILO, а где вы вставляете приведенные вам куски? Может слишком поздно и он не успевает сработать? AMILO 1 Quote Link to post Share on other sites
AMILO 36 Posted October 12, 2014 Author Report Share Posted October 12, 2014 @Indigo88, я уже по-разному пробовал... И спереди, и внутри, и в конце... Результата нет... Quote Link to post Share on other sites
zenn 266 Posted October 12, 2014 Report Share Posted October 12, 2014 Сколько нужно комнатных оптимизаторов чтобы исправить роутинг? Эта тема тому пример. Во вложенной директории (2ой скрипт) в .htaccess добавить (после RewriteEngine on): RewriteBase /myapp/ Гайд: http://httpd.apache.org/docs/current/mod/mod_rewrite.html#rewritebase Уверен на 90% что решит все вопросы ) AMILO 1 Quote Link to post Share on other sites
AMILO 36 Posted October 12, 2014 Author Report Share Posted October 12, 2014 @zenn, Привет) Во-втором скрипте .htaccess вообще пустой. Quote Link to post Share on other sites
zenn 266 Posted October 12, 2014 Report Share Posted October 12, 2014 @zenn, Привет) Во-втором скрипте .htaccess вообще пустой. Создайте и установите это правило(оно запретит выше лежащему перезаписывать роуты). Всего 2 строки - включить rewrite и установить baseurl. Или в выше лежащем попробуйте заменить: <Directory /forum> RewriteEngine Off </Directory> <Directory /> RewriteEngine On blablabla весь прочий шлак </Directory> Quote Link to post Share on other sites
VIP BayBackOff 371 Posted October 12, 2014 VIP Report Share Posted October 12, 2014 Сколько нужно комнатных оптимизаторов чтобы исправить роутинг? Эта тема тому пример. Ровно столько , сколько и клавишных идолоподобных виртуальных героев P.S. По себе людей не судят... Quote Link to post Share on other sites
AMILO 36 Posted October 12, 2014 Author Report Share Posted October 12, 2014 @zenn, можете напечатать мне что именно надо добавить в .htaccess второго скрипта? Сейчас файл абсолютно пустой. Quote Link to post Share on other sites
Indigo88 30 Posted October 12, 2014 Report Share Posted October 12, 2014 Не надо начинать срач Quote Link to post Share on other sites
Indigo88 30 Posted October 12, 2014 Report Share Posted October 12, 2014 @zenn, можете напечатать мне что именно надо добавить в .htaccess второго скрипта? Сейчас файл абсолютно пустой. Я так понял что RewriteBase /forum/ Quote Link to post Share on other sites
zenn 266 Posted October 12, 2014 Report Share Posted October 12, 2014 @zenn, можете напечатать мне что именно надо добавить в .htaccess второго скрипта? Сейчас файл абсолютно пустой. RewriteEngine On RewriteBase /forum/ или: RewriteEngine Off Или попробовать привести основной (выше лежащий) htaccess к виду, как я изложил выше. Quote Link to post Share on other sites
AMILO 36 Posted October 12, 2014 Author Report Share Posted October 12, 2014 @zenn, содержимое первого .htaccess DirectoryIndex index.php Options -Indexes Allow from all <Files "*.htaccess"> order allow,deny deny from all </Files> <Files ~ "php.ini"> Order allow,deny Deny from All </Files> <Files "*.inc"> order allow,deny deny from all </Files> <Files "*.tpl"> order allow,deny deny from all </Files> <Files ~ "\.(htaccess|htpasswd|inc|dat|ini)$"> Deny from All </Files> RemoveHandler .html .htm AddType application/x-httpd-php .php .htm .html .phtml .inc AddDefaultCharset utf-8 RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ index.php?wtpath=$1&wtquery=%{QUERY_STRING} [L] ErrorDocument 400 /index.php?section=errordocument&errcode=400 ErrorDocument 401 /index.php?section=errordocument&errcode=401 ErrorDocument 403 /index.php?section=errordocument&errcode=403 ErrorDocument 404 /index.php?section=errordocument&errcode=404 php_flag magic_quotes_gpc 0 php_flag magic_quotes_runtime 0 Содержимое второго - пустой. Если я меняю так как вы говорите - то по адресу site.ru - открывается форум. Quote Link to post Share on other sites
zenn 266 Posted October 12, 2014 Report Share Posted October 12, 2014 @zenn, содержимое первого .htaccess DirectoryIndex index.php Options -Indexes Allow from all <Files "*.htaccess"> order allow,deny deny from all </Files> <Files ~ "php.ini"> Order allow,deny Deny from All </Files> <Files "*.inc"> order allow,deny deny from all </Files> <Files "*.tpl"> order allow,deny deny from all </Files> <Files ~ "\.(htaccess|htpasswd|inc|dat|ini)$"> Deny from All </Files> RemoveHandler .html .htm AddType application/x-httpd-php .php .htm .html .phtml .inc AddDefaultCharset utf-8 RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ index.php?wtpath=$1&wtquery=%{QUERY_STRING} [L] ErrorDocument 400 /index.php?section=errordocument&errcode=400 ErrorDocument 401 /index.php?section=errordocument&errcode=401 ErrorDocument 403 /index.php?section=errordocument&errcode=403 ErrorDocument 404 /index.php?section=errordocument&errcode=404 php_flag magic_quotes_gpc 0 php_flag magic_quotes_runtime 0 Содержимое второго - пустой. Если я меняю так как вы говорите - то по адресу site.ru - открывается форум. Такого быть не может, если вы понимаете что делаете. Такое произойдет только если вы в основной .htaccess запишите то, что предназначалось для форумного ... Неужели вы 3 строчки прочесть не можете? Quote Link to post Share on other sites
AMILO 36 Posted October 12, 2014 Author Report Share Posted October 12, 2014 @zenn, ну отредактируйте мне первый .htaccess так, как вы считаете правильно. Quote Link to post Share on other sites
zenn 266 Posted October 12, 2014 Report Share Posted October 12, 2014 @zenn, ну отредактируйте мне первый .htaccess так, как вы считаете правильно. Может быть вас еще с ложечки покормить, на горшок сводить? Самый простой путь, повторю еще раз, открыть в файловом менеджере директорию, куда загружен форум. Создать файл: .htaccess В него поместить: RewriteEngine Off проверить в браузере - не помогло, попробовать: RewriteEngine On RewriteBase /forum/ не помогло - заменить главный(в корне сайта, НЕ ФОРУМА) на (не предпочтительный вариант): DirectoryIndex index.php Options -Indexes Allow from all <Files "*.htaccess"> order allow,deny deny from all </Files> <Files ~ "php.ini"> Order allow,deny Deny from All </Files> <Files "*.inc"> order allow,deny deny from all </Files> <Files "*.tpl"> order allow,deny deny from all </Files> <Files ~ "\.(htaccess|htpasswd|inc|dat|ini)$"> Deny from All </Files> <Directory /forum> RewriteEngine off </Directory> <Directory /> RemoveHandler .html .htm AddType application/x-httpd-php .php .htm .html .phtml .inc AddDefaultCharset utf-8 RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ index.php?wtpath=$1&wtquery=%{QUERY_STRING} [L] ErrorDocument 400 /index.php?section=errordocument&errcode=400 ErrorDocument 401 /index.php?section=errordocument&errcode=401 ErrorDocument 403 /index.php?section=errordocument&errcode=403 ErrorDocument 404 /index.php?section=errordocument&errcode=404 php_flag magic_quotes_gpc 0 php_flag magic_quotes_runtime 0 </Directory> Indigo88 and AMILO 2 Quote Link to post Share on other sites
Indigo88 30 Posted October 12, 2014 Report Share Posted October 12, 2014 Сдается мне что последний вариант должен 100% работать. Впервые вижу такую структуру, спасибо Quote Link to post Share on other sites
Indigo88 30 Posted October 12, 2014 Report Share Posted October 12, 2014 @zenn, а почему он не предпочтительный? Quote Link to post Share on other sites
AMILO 36 Posted October 12, 2014 Author Report Share Posted October 12, 2014 @zenn, Отвечаю по порядку. 1-й случай, ничего не меняется, циклическая переадресация на: The requested URL /forum/index.phpforum/index.phpforum/index.phpforum/index.phpforum/index.phpforum/index.phpforum/index.phpforum/index.phpforum/index.phpforum/index.phpforum/index.phpforum/index.phpforum/index.phpforum/index.phpforum/index.phpforum/index.phpforum/index.phpforum/index.phpforum/index.phpforum/index.phpforum/index.phpforum/ was not found on this server. 2-й случай - тоже самое. 3-й случай: 500 Server error. Quote Link to post Share on other sites
zenn 266 Posted October 12, 2014 Report Share Posted October 12, 2014 Значить добавить DirectoryIndex указатель к первым 2м примерам. Quote Link to post Share on other sites
AMILO 36 Posted October 12, 2014 Author Report Share Posted October 12, 2014 RewriteEngine off RemoveHandler .html .htm AddType application/x-httpd-php .php .htm .html .phtml .inc AddDefaultCharset utf-8 RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ index.php?wtpath=$1&wtquery=%{QUERY_STRING} [L] ErrorDocument 400 /index.php?section=errordocument&errcode=400 ErrorDocument 401 /index.php?section=errordocument&errcode=401 ErrorDocument 403 /index.php?section=errordocument&errcode=403 ErrorDocument 404 /index.php?section=errordocument&errcode=404 php_flag magic_quotes_gpc 0 php_flag magic_quotes_runtime 0 Ошибка 500. Короче, забиваю. Quote Link to post Share on other sites
saskozp 205 Posted October 12, 2014 Report Share Posted October 12, 2014 в файл htaccessдобавить после всего Redirect 301 /forum http://site.ru/forum/index.php а вообще, какая проблема, если открывается http://site.ru/forum/index.php, то пусть так и открывается )) Quote Link to post Share on other sites
AMILO 36 Posted October 12, 2014 Author Report Share Posted October 12, 2014 @saskozp, Не работает. Пишет: На этой странице обнаружена циклическая переадресация Quote Link to post Share on other sites
zenn 266 Posted October 13, 2014 Report Share Posted October 13, 2014 В общем я не знаю что у вас с веб-сервером, провел тестирование на локалке - все хорошо с любым из моих примеров. Держите тестовый архив: https://yadi.sk/d/bi-kP0NnbxZra AMILO 1 Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.