<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Форум АлаичЪ'а о SEO - Утонул в .htaccess]]></title>
	<link rel="self" href="https://talk.alaev.info/feed/atom/topic/647/" />
	<updated>2013-04-17T19:11:22Z</updated>
	<generator>PunBB</generator>
	<id>https://talk.alaev.info/topic/647/</id>
		<entry>
			<title type="html"><![CDATA[Re: Утонул в .htaccess]]></title>
			<link rel="alternate" href="https://talk.alaev.info/post/4649/#p4649" />
			<content type="html"><![CDATA[<p>Все нормально открывается конечно, у меня проблема была со ссылками, elseif ($_GET[&#039;act&#039;]==forma.&#039;.html&#039;) все нормально открывалось, но ссылки формата elseif ($_GET[&#039;act&#039;]==ab-cd_forma.&#039;.html&#039;) выкидывало в 404, уже разобрался, нужно было левую часть ссылки в кавычки закрыть. Спасибо за помощь.</p>]]></content>
			<author>
				<name><![CDATA[roman]]></name>
				<uri>https://talk.alaev.info/user/258/</uri>
			</author>
			<updated>2013-04-17T19:11:22Z</updated>
			<id>https://talk.alaev.info/post/4649/#p4649</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Утонул в .htaccess]]></title>
			<link rel="alternate" href="https://talk.alaev.info/post/4640/#p4640" />
			<content type="html"><![CDATA[<p><strong>roman</strong>, Ничего не понятно. Но скажи лучше, по нужным тебе якобыЧПУ урлам открываются нужные страницы?<br />Т.е. при вводе в браузере http://домен/forma.html открывается та самая нужная страница?</p>]]></content>
			<author>
				<name><![CDATA[admin]]></name>
				<uri>https://talk.alaev.info/user/2/</uri>
			</author>
			<updated>2013-04-17T03:08:27Z</updated>
			<id>https://talk.alaev.info/post/4640/#p4640</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Утонул в .htaccess]]></title>
			<link rel="alternate" href="https://talk.alaev.info/post/4628/#p4628" />
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[roman]]></name>
				<uri>https://talk.alaev.info/user/258/</uri>
			</author>
			<updated>2013-04-16T13:22:46Z</updated>
			<id>https://talk.alaev.info/post/4628/#p4628</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Утонул в .htaccess]]></title>
			<link rel="alternate" href="https://talk.alaev.info/post/4623/#p4623" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>roman пишет:</cite><blockquote><p>Ну и может в коде напутал</p></blockquote></div><p>Напутал? Да ты вообще какой-то ад написал.<br />ЧПУ не только в htaccess заключается, но и в файлах php надо прописывать правила формирования url&#039;ов - если ты не знаешь что и как там сделать - оставь затею, а то сделаешь только хуже.</p>]]></content>
			<author>
				<name><![CDATA[admin]]></name>
				<uri>https://talk.alaev.info/user/2/</uri>
			</author>
			<updated>2013-04-16T05:34:53Z</updated>
			<id>https://talk.alaev.info/post/4623/#p4623</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Утонул в .htaccess]]></title>
			<link rel="alternate" href="https://talk.alaev.info/post/4614/#p4614" />
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[roman]]></name>
				<uri>https://talk.alaev.info/user/258/</uri>
			</author>
			<updated>2013-04-15T18:43:08Z</updated>
			<id>https://talk.alaev.info/post/4614/#p4614</id>
		</entry>
</feed>
