<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Форум АлаичЪ'а о SEO - Утонул в .htaccess]]></title>
		<link>https://talk.alaev.info/topic/647/</link>
		<atom:link href="https://talk.alaev.info/feed/rss/topic/647/" rel="self" type="application/rss+xml" />
		<description><![CDATA[Недавние сообщения в теме «Утонул в .htaccess».]]></description>
		<lastBuildDate>Wed, 17 Apr 2013 19:11:22 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Утонул в .htaccess]]></title>
			<link>https://talk.alaev.info/post/4649/#p4649</link>
			<description><![CDATA[<p>Все нормально открывается конечно, у меня проблема была со ссылками, elseif ($_GET[&#039;act&#039;]==forma.&#039;.html&#039;) все нормально открывалось, но ссылки формата elseif ($_GET[&#039;act&#039;]==ab-cd_forma.&#039;.html&#039;) выкидывало в 404, уже разобрался, нужно было левую часть ссылки в кавычки закрыть. Спасибо за помощь.</p>]]></description>
			<author><![CDATA[null@example.com (roman)]]></author>
			<pubDate>Wed, 17 Apr 2013 19:11:22 +0000</pubDate>
			<guid>https://talk.alaev.info/post/4649/#p4649</guid>
		</item>
		<item>
			<title><![CDATA[Re: Утонул в .htaccess]]></title>
			<link>https://talk.alaev.info/post/4640/#p4640</link>
			<description><![CDATA[<p><strong>roman</strong>, Ничего не понятно. Но скажи лучше, по нужным тебе якобыЧПУ урлам открываются нужные страницы?<br />Т.е. при вводе в браузере http://домен/forma.html открывается та самая нужная страница?</p>]]></description>
			<author><![CDATA[null@example.com (admin)]]></author>
			<pubDate>Wed, 17 Apr 2013 03:08:27 +0000</pubDate>
			<guid>https://talk.alaev.info/post/4640/#p4640</guid>
		</item>
		<item>
			<title><![CDATA[Re: Утонул в .htaccess]]></title>
			<link>https://talk.alaev.info/post/4628/#p4628</link>
			<description><![CDATA[<p>Грубо файл index.php такой:<br />&lt;?php<br /> include(&#039;шапка.php&#039;);<br /> include(&#039;меню.php&#039;);<br />if (isset($_GET[&#039;act&#039;]))<br />&nbsp; &nbsp; {$file=&#039;error404.php&#039;;<br />if ($_GET[&#039;act&#039;]==1)<br />&nbsp; &nbsp; {$file = &#039;template/str1.html&#039;;}</p><p>elseif ($_GET[&#039;act&#039;]==forma.&#039;.html&#039;)<br />&nbsp; &nbsp; {$file = &#039;template/str2.html&#039;;}<br />elseif ($_GET[&#039;act&#039;]==options.&#039;.html&#039;)<br />&nbsp; &nbsp; {$file = &#039;template/str3.html&#039;;}<br />else<br />&nbsp; &nbsp; {$file = &#039;error404.php&#039;;}<br />&nbsp; &nbsp; include($file);}<br /> include(&quot;футер.php&quot;);<br />?&gt;</p><p>Инклюдятся шапка и меню подгружаются контент и футер.<br />Линки соотвецтвенно: <br />http://домен/index.php?act=1 (главная)<br />http://домен/index.php?act=forma.html (контент из template/str2.html)<br />http://домен/index.php?act=options.html (контент из template/str3.html)</p><p>Да, вид ссылки http://домен/index.php?act=forma.html мне не понравился, изменил его на http://домен/forma.html о чем выше и написал.<br />Что тут такого адового в формировании url&#039;ов, и к чему столько патетики, не понимаю, обьясни.</p>]]></description>
			<author><![CDATA[null@example.com (roman)]]></author>
			<pubDate>Tue, 16 Apr 2013 13:22:46 +0000</pubDate>
			<guid>https://talk.alaev.info/post/4628/#p4628</guid>
		</item>
		<item>
			<title><![CDATA[Re: Утонул в .htaccess]]></title>
			<link>https://talk.alaev.info/post/4623/#p4623</link>
			<description><![CDATA[<div class="quotebox"><cite>roman пишет:</cite><blockquote><p>Ну и может в коде напутал</p></blockquote></div><p>Напутал? Да ты вообще какой-то ад написал.<br />ЧПУ не только в htaccess заключается, но и в файлах php надо прописывать правила формирования url&#039;ов - если ты не знаешь что и как там сделать - оставь затею, а то сделаешь только хуже.</p>]]></description>
			<author><![CDATA[null@example.com (admin)]]></author>
			<pubDate>Tue, 16 Apr 2013 05:34:53 +0000</pubDate>
			<guid>https://talk.alaev.info/post/4623/#p4623</guid>
		</item>
		<item>
			<title><![CDATA[Утонул в .htaccess]]></title>
			<link>https://talk.alaev.info/post/4614/#p4614</link>
			<description><![CDATA[<p>Помогите советом, я уже совсем завяз <img src="https://talk.alaev.info/img/smilies/sad.png" width="15" height="15" alt="sad" /> На динамическом сайте имею ссылки формата site.ru/index.php?act=1 и хочу преобразовать их в site.ru/***.html</p><p>Изначально в index.php такая конструкция:<br /></p><div class="codebox"><pre><code>    if (isset($_GET[&#039;act&#039;]))
    {$file=&#039;error404.php&#039;;
    if ($_GET[&#039;act&#039;]==1)
    {$file = &#039;template/str1.html&#039;;}
    elseif ($_GET[&#039;act&#039;]==forma.&#039;.html&#039;)
    {$file = &#039;template/str2.html&#039;;}
    elseif ($_GET[&#039;act&#039;]==options.&#039;.html&#039;)
    {$file = &#039;template/str3.html&#039;;}</code></pre></div><p>Настраиваю .htaccess <br /></p><div class="codebox"><pre><code>RewriteEngine On
RewriteBase /

# Убрать из дир. завершающий слэш 
RewriteRule ^(.*)(/)$ $1 [L,R=301]

# Имена и последовательность индексных файлов
DirectoryIndex index.php?act=1 

# Определяю главное зеркало
RewriteCond %{HTTP_HOST} ^www\.site\.ru$ [NC]
RewriteRule ^(.*)$ http://site.ru/$1 [R=301,L]   

# Запрет прямого захода в дир. template
RewriteRule ^template(.*)$ /error404.php [L,R=301]

# Редиректы с /index.php на /
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\.php\ HTTP/
RewriteRule ^index\.php$ / [R=301,L]

# Редирект с первой страницы на хост
RewriteRule ^act=1(.*)$ / [L,R=301]
RewriteRule ^1(.*)$ / [L,R=301]

# ЧПУ
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?act=$1 [L,QSA]</code></pre></div><p>Ссылки вида site.ru/file.html теперь работают, но режутся<br />- и _ если линк вида /6-ab-cd.html или /ab_cd_ef.html никак не получается исправить <img src="https://talk.alaev.info/img/smilies/sad.png" width="15" height="15" alt="sad" /> </p><p>Ну и может в коде напутал, посмотрите опытным глазом если не трудно, для меня все это еще сумерки. Спасибо.</p>]]></description>
			<author><![CDATA[null@example.com (roman)]]></author>
			<pubDate>Mon, 15 Apr 2013 18:43:08 +0000</pubDate>
			<guid>https://talk.alaev.info/post/4614/#p4614</guid>
		</item>
	</channel>
</rss>
