|
Правила •
Регистрация •
Справка Сообщения за день • Поиск |
|
|
|
|
Опции темы | Опции просмотра |
Arbeit macht Frei
|
Стараюсь все новые модули изначально писать с ЧПУ (магазин, телефоны вот еще...)
А так все очень индивидуально в каждом модуле... Ronny CMS? Yes! |
||||
|
|
Младший участник
|
Так это понятно. Тема эта поднималась уже несколько раз. Просто одно дело -htaccess поменять, а другое - весь портал перелопачивать, исправляя ссылки. Вот я и спрашиваю, а м.б. кто-то уже делал mod_rewrite для других модулей? Выложили бы, потом объединим.
|
||||
|
|
): ǝҺɐни dиw ɐн иd⊥оwɔ
|
Цитата:
Напильник для RUNCMS Строим помаленьку Для гурманов Мебель для дома |
||||
|
|
Стар я для всего этого
|
news и myarticles я делал тут http://www.runcms.ru/forum/showthread.php?t=5618
Не совсем правда корректно "А почему в RunCMS глючит ... ?" "Глупые винят других. Умные – себя. А мудрые идут вперед". (С) |
||||
|
|
Младший участник
|
Вот, правда, не везде работает, (скажем, в рейтинге файлов). Но вроде ОК: Для Files: В .htaccess RewriteEngine On #Новости RewriteRule ^article([1-9][0-9]*).html /modules/news/article.php?storyid=$1 RewriteRule ^article([1-9][0-9]*)_([0-9][0-9]*).html /modules/news/article.php?storyid=$1&storypage=$2 RewriteRule ^print([1-9][0-9]*).html /modules/news/print.php?storyid=$1 RewriteRule ^topic([1-9][0-9]*).html /modules/news/index.php?storytopic=$1 RewriteRule ^submit.html /modules/news/submit.php RewriteRule ^archive.html /modules/news/archive.php RewriteRule ^topics.html /modules/news/topics.php RewriteRule ^archive([1-9][0-9][0-9][0-9]*)_([0-9][0-9]*).html /modules/news/archive.php?op=get&year=$1&month=$2 #Ссылки RewriteRule ^links([1-9][0-9]*).html /modules/mylinks/viewcat.php?cid=$1 RewriteRule ^links/submit.html /modules/mylinks/submit.php RewriteRule ^links/hit.html /modules/mylinks/topten.php?hit=1 RewriteRule ^links/rate.html /modules/mylinks/topten.php?rate=1 #Files RewriteRule ^files([1-9][0-9]*).html$ /modules/files/showfile.php?lid=$1 [L] RewriteRule ^files([1-9][0-9]*).html$ /modules/files/viewcat.php?cid=$1 [L] RewriteRule ^files/hit.html /modules/files/topten.php?hit=1 [L] RewriteRule ^files/rate.html /modules/files/topten.php?rate=1 [L] В emulator.php: <?php function x_rewrite_url(&$tpl_output) { $in = array( //Новости "/modules\/news\/article.php\?storyid=([1-9][0-9]*)&storypage=([0-9][0-9]*)/", "/modules\/news\/article.php\?storyid=([1-9][0-9]*)/", "/modules\/news\/article.php\?item_id=([1-9][0-9]*)&storypage=([1-9][0-9]*)/", "/modules\/news\/article.php\?item_id=([1-9][0-9]*)/", "/modules\/news\/print.php\?storyid=([1-9][0-9]*)/", "/modules\/news\/index.php\?storytopic=([1-9][0-9]*)/", "/modules\/news\/submit.php/", "/modules\/news\/archive.php/", "/modules\/news\/topics.php/", "/archive.php\?op=get&year=([1-9][0-9][0-9][0-9]*)&month=([0-9][0-9]*)/", //Ссылки "/modules\/mylinks\/viewcat.php\?cid=([1-9][0-9]*)/", "/modules\/mylinks\/submit.php/", "/modules\/mylinks\/topten.php\?hit=1/", "/modules\/mylinks\/topten.php\?rate=1/", //Files "/modules\/files\/showfile.php\?lid=([1-9][0-9]*)/", "/modules\/files\/viewcat.php\?cid=([1-9][0-9]*)/", "/modules\/files\/topten.php\?hit=([1-9][0-9]*)/", "/modules\/files\/topten.php\?rate=([1-9][0-9]*)/", "/files\/showfile.php\?lid=([1-9][0-9]*)/", ); $out = array( //Новости "article\\1_\\2.html" , "article\\1.html" , "article\\1_\\2.html" , "article\\1.html" , "print\\1.html" , "topic\\1.html" , "submit.html" , "archive.html" , "topics.html" , "archive\\1_\\2.html" , ", //Ссылки "links\\1.html" , "links\\submit.html", "links\\hit.html", "links\\rate.html", //Файлы "files\\1.html", "files\\1.html", "files\\/hit.html", "files\\/rate.html", "file\\1.html", ); $tpl_output = preg_replace($in, $out, $tpl_output); return $tpl_output; } ?> |
||||
|
|
Участник
|
demon я сделал по твоему принципу, но ничего не работает. Т.е. если например набрать http://mysite/files2.html, то работает, однако такие ссылки не появились в модуле files.
Информационный интернет портал InfoPortal.net.ru |
||||
|
|
): ǝҺɐни dиw ɐн иd⊥оwɔ
|
Надо ее в common.php внести изменения, ищи по слову псевдостатика
Напильник для RUNCMS Строим помаленьку Для гурманов Мебель для дома |
||||
|
|
Участник
|
Заменил в common.php строки. Эта тема обсуждалась здесь http://www.runcms.ru/forum/showthrea...E0%F2%E8%EA%E0
Но после выключения gzip выдаёт ошибку Parse error: parse error, unexpected T_STRING, expecting ')' in x:\home\infoportal\www\emulator.php on line 41 А сделав runcmsT Michael-XIII всё работает. Уже давно стоит и проблем нет, кроме комментариев в news. Но только у него сделан mod_rewrite на news и myarticles, а хотелось бы ещё на files и mylinks. Может быть я что-то не то меняю в /include/common.php? Информационный интернет портал InfoPortal.net.ru |
||||
|
|
Младший участник
|
Вот еще, немного изменено (работает все). Читал этот топик
./htaccess RewriteEngine On #Новости RewriteRule ^article([1-9][0-9]*).html /modules/news/article.php?storyid=$1 RewriteRule ^article([1-9][0-9]*)_([0-9][0-9]*).html /modules/news/article.php?storyid=$1&storypage=$2 RewriteRule ^print([1-9][0-9]*).html /modules/news/print.php?storyid=$1 RewriteRule ^topic([1-9][0-9]*).html /modules/news/index.php?storytopic=$1 RewriteRule ^submit.html /modules/news/submit.php RewriteRule ^archive.html /modules/news/archive.php RewriteRule ^topics.html /modules/news/topics.php RewriteRule ^archive([1-9][0-9][0-9][0-9]*)_([0-9][0-9]*).html /modules/news/archive.php?op=get&year=$1&month=$2 #Архив файлов RewriteRule ^downloads([1-9][0-9]*).html /modules/mydownloads/viewcat.php?cid=$1 RewriteRule ^downloads/submit.html /modules/mydownloads/submit.php RewriteRule ^downloads/hit.html /modules/mydownloads/topten.php?hit=1 RewriteRule ^downloads/rate.html /modules/mydownloads/topten.php?rate=1 #Ссылки RewriteRule ^links([1-9][0-9]*).html /modules/mylinks/viewcat.php?cid=$1 RewriteRule ^links/submit.html /modules/mylinks/submit.php RewriteRule ^links/hit.html /modules/mylinks/topten.php?hit=1 RewriteRule ^links/rate.html /modules/mylinks/topten.php?rate=1 #Форум RewriteRule ^forum/category([1-9][0-9]*).html /modules/newbb/index.php?viewcat=$1 RewriteRule ^forum/forum([1-9][0-9]*).html /modules/newbb/viewforum.php?forum=$1 RewriteRule ^forum/topic([1-9][0-9]*)_([0-9][0-9]*).html /modules/newbb/viewtopic.php?topic_id=$1&forum$2 #Files RewriteRule ^files([1-9][0-9]*).html$ /modules/files/showfile.php?lid=$1 [L] RewriteRule ^files([1-9][0-9]*).html$ /modules/files/viewcat.php?cid=$1 [L] RewriteRule ^files/hit.html /modules/files/topten.php?hit=1 [L] RewriteRule ^files/rate.html /modules/files/topten.php?rate=1 [L] RewriteRule ^article([1-9][0-9]*).html$ /article.php?storyid=$ [L] emulator.php <?php function x_rewrite_url(&$tpl_output) { $in = array( //Новости "/modules\/news\/article.php\?storyid=([1-9][0-9]*)&storypage=([0-9][0-9]*)/", "/modules\/news\/article.php\?storyid=([1-9][0-9]*)/", "/modules\/news\/article.php\?item_id=([1-9][0-9]*)&storypage=([1-9][0-9]*)/", "/modules\/news\/article.php\?item_id=([1-9][0-9]*)/", "/modules\/news\/print.php\?storyid=([1-9][0-9]*)/", "/modules\/news\/index.php\?storytopic=([1-9][0-9]*)/", "/modules\/news\/submit.php/", "/modules\/news\/archive.php/", "/modules\/news\/topics.php/", "/archive.php\?op=get&year=([1-9][0-9][0-9][0-9]*)&month=([0-9][0-9]*)/", "/article.php\?storyid=([1-9][0-9]*)/", //Архив файлов "/modules\/mydownloads\/viewcat.php\?cid=([1-9][0-9]*)/", "/modules\/mydownloads\/submit.php/", "/modules\/mydownloads\/topten.php\?hit=1/", "/modules\/mydownloads\/topten.php\?rate=1/", //Ссылки "/modules\/mylinks\/viewcat.php\?cid=([1-9][0-9]*)/", "/modules\/mylinks\/submit.php/", "/modules\/mylinks\/topten.php\?hit=1/", "/modules\/mylinks\/topten.php\?rate=1/", //Форум "/modules\/newbb\/index.php\?viewcat=([1-9][0-9]*)/", "/modules\/newbb\/viewforum.php\?forum=([1-9][0-9]*)/", "/modules\/newbb\/viewtopic.php\?topic_id=([1-9][0-9]*)&forum=([0-9][0-9]*)/", //Files "/modules\/files\/showfile.php\?lid=([1-9][0-9]*)/", "/modules\/files\/viewcat.php\?cid=([1-9][0-9]*)/", "/modules\/files\/topten.php\?hit=([1-9][0-9]*)/", "/modules\/files\/topten.php\?rate=([1-9][0-9]*)/", ); $out = array( //Новости "article\\1_\\2.html" , "article\\1.html" , "article\\1_\\2.html" , "article\\1.html" , "print\\1.html" , "topic\\1.html" , "submit.html" , "archive.html" , "topics.html" , "archive\\1_\\2.html" , "article\\1.html", //Архив файлов "downloads\\1.html" , "downloads\\submit.html", "downloads\\hit.html", "downloads\\rate.html", //Ссылки "links\\1.html" , "links\\submit.html", "links\\hit.html", "links\\rate.html", //Форум "forum\\category\\1.html", "forum\\forum\\1.html", "forum\\topic\\1_\\2.html" , //Файлы "files\\1.html", "files\\1.html", "files\\/hit.html", "files\\/rate.html", ); $tpl_output = preg_replace($in, $out, $tpl_output); return $tpl_output; } ?> |
||||
|
|
|
|
Опции темы | |
Опции просмотра | |
|
|
Powered by: vBulletin Version 3.0 Copyright ©2000-2024, Jelsoft Enterprises Ltd. |
Все разделы прочитаны - Руководство форума - Архив - Вверх |