﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>Релиб / Веб-программирование / Веб-программирование  / modrewrite в .htaccess / Latest Posts</title><generator>InstantForum.NET v4.1.4</generator><description>Релиб</description><link>http://www.relib.com/forums/</link><webMaster>robot@relib.com</webMaster><lastBuildDate>Sun, 23 Nov 2008 00:22:51 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: modrewrite в .htaccess</title><link>http://www.relib.com/forums/Topic903567-9-1.aspx</link><description>Ты гений! спасибо огромное!</description><pubDate>Wed, 30 Aug 2006 12:35:59 GMT</pubDate><dc:creator>ChiEF</dc:creator></item><item><title>RE: modrewrite в .htaccess</title><link>http://www.relib.com/forums/Topic903567-9-1.aspx</link><description>Можно сделать два правила: одно со слешем, другое без&lt;P&gt;[code]RewriteRule ^b-([0-9]+)/$ /b-$1/index.html [R=301,L]&lt;BR&gt;RewriteRule ^b-([0-9]+)$ /b-$1/index.html [R=301,L][/code]&lt;/P&gt;&lt;P&gt;Но лучше это выразить одной строкой&lt;/P&gt;&lt;P&gt;[code]RewriteRule ^b-([0-9]+)/?$ /b-$1/index.html [R=301,L][/code]</description><pubDate>Wed, 30 Aug 2006 12:28:55 GMT</pubDate><dc:creator>bazile</dc:creator></item><item><title>RE: modrewrite в .htaccess</title><link>http://www.relib.com/forums/Topic903567-9-1.aspx</link><description>да работает так:&lt;/P&gt;&lt;P&gt;набираю  b-1/ - ок идет на b-1/index.html&lt;/P&gt;&lt;P&gt;a если без слеша, просто  b-1  то 404&lt;/P&gt;&lt;P&gt;и это уже не поправишь?</description><pubDate>Wed, 30 Aug 2006 12:14:03 GMT</pubDate><dc:creator>ChiEF</dc:creator></item><item><title>RE: modrewrite в .htaccess</title><link>http://www.relib.com/forums/Topic903567-9-1.aspx</link><description>У меня все работает. Единственное, что я бы добавил слеш в ссылке на которую происходит редирект.&lt;P&gt;[code]RewriteRule ^b-([0-9]+)/$    /b-$1/index.html    [R=301,L][/code]</description><pubDate>Wed, 30 Aug 2006 11:47:34 GMT</pubDate><dc:creator>bazile</dc:creator></item><item><title>RE: modrewrite в .htaccess</title><link>http://www.relib.com/forums/Topic903567-9-1.aspx</link><description>не канает - выдает 404 (((</description><pubDate>Wed, 30 Aug 2006 11:23:36 GMT</pubDate><dc:creator>ChiEF</dc:creator></item><item><title>RE: modrewrite в .htaccess</title><link>http://www.relib.com/forums/Topic903567-9-1.aspx</link><description>Так попробуй&lt;/P&gt;&lt;P&gt;RewriteRule ^b-([0-9]+)/$ b-$1/index.html [R=301,L]</description><pubDate>Wed, 30 Aug 2006 11:15:35 GMT</pubDate><dc:creator>bazile</dc:creator></item><item><title>modrewrite в .htaccess</title><link>http://www.relib.com/forums/Topic903567-9-1.aspx</link><description>Вобщет вот то что в файле .htaccess:&lt;/P&gt;&lt;P&gt;[code]&lt;/P&gt;&lt;P&gt;RewriteEngine on &lt;BR&gt;RewriteRule ^b-([0-9]+)/index.html$ fh/index.php?id=$1&lt;BR&gt;RewriteRule ^b-([0-9]+)/main.html$ fh/main.php?id=$1&lt;BR&gt;RewriteRule ^b-([0-9]+)/g-([0-9]+).html$ fh/g.php?id=$1&amp;amp;gal=$2&lt;/P&gt;&lt;P&gt;[/code]&lt;/P&gt;&lt;P&gt;В этом коде всё работеат, но проблема такова: &lt;/P&gt;&lt;P&gt;как сделать что-бы при заходе в папку  к примеру /b-1/&lt;/P&gt;&lt;P&gt;не выдавало 404, а редиректилось на /b-1/index.html&lt;/P&gt;&lt;P&gt;Как это замутить? а то так делать неoхота:&lt;/P&gt;&lt;P&gt;ErrorDocument 404 &lt;A href="http://www.sitename.com"&gt;http://www.sitename.com&lt;/A&gt;&lt;BR&gt;</description><pubDate>Wed, 30 Aug 2006 10:58:56 GMT</pubDate><dc:creator>ChiEF</dc:creator></item></channel></rss>