<?xml version="1.0" encoding="utf-8"?><?xml-stylesheet title="XSL formatting" type="text/xsl" href="http://www.llaumgui.com/feed/rss2/xslt" ?><rss version="2.0"
  xmlns:dc="http://purl.org/dc/elements/1.1/"
  xmlns:wfw="http://wellformedweb.org/CommentAPI/"
  xmlns:content="http://purl.org/rss/1.0/modules/content/"
  xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
  <title>Le blog de llaumgui - Balise - htaccess</title>
  <link>http://www.llaumgui.com/</link>
  <atom:link href="http://www.llaumgui.com/feed/tag/htaccess/rss2" rel="self" type="application/rss+xml"/>
  <description>Linux en général, Fedora en particulier...</description>
  <language>fr</language>
  <pubDate>Wed, 03 Dec 2008 15:54:44 +0100</pubDate>
  <copyright>http://creativecommons.org/licenses/by-nc-nd/2.5/</copyright>
  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
  <generator>Dotclear</generator>
  
    
  <item>
    <title>DotClear 2.0 et les redirections d'url</title>
    <link>http://www.llaumgui.com/post/DotClear-20-et-les-redirections-durl</link>
    <guid isPermaLink="false">urn:md5:26e897d1eb3c8ecbe2888e69f3f49402</guid>
    <pubDate>Mon, 21 Aug 2006 16:35:00 +0200</pubDate>
    <dc:creator>llaumgui</dc:creator>
        <category>Développement web</category>
        <category>apache</category><category>Dotclear</category><category>htaccess</category><category>llaumgui.com</category><category>serveur</category>    
    <description>&lt;p&gt;La forme des urls sous &lt;a href=&quot;http://www.dotclear.net&quot; hreflang=&quot;fr&quot; title=&quot;DotClear&quot;&gt;DotClear&lt;/a&gt; 1 et sous DotClear 2 est légèrement différente. Le &lt;a href=&quot;http://www.dotclear.net/forum&quot; hreflang=&quot;fr&quot; title=&quot;Forum DotClear&quot;&gt;forum officiel&lt;/a&gt; propose bien &lt;a href=&quot;http://www.dotclear.net/forum/viewtopic.php?id=19425&quot; hreflang=&quot;fr&quot; title=&quot;Forum DotClear&quot;&gt;une solution&lt;/a&gt;, malheureusement ayant modifié mes adresses à la fois sous DotClear 1 et sous DotClear 2.0, je ne peux appliquer cette astuce.
J'ai donc du me faire un petit fichier .htaccess perso.&lt;/p&gt;    &lt;h2&gt;Petit récapitulatif des différences entre les urls de DotClear 1 et celle de DotClear 2 :&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;DotClear 1 standard :&lt;/strong&gt; index.php/annee/mois/jour/id-titre_du_billet&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;DotClear 1 LLaumgui :&lt;/strong&gt;&amp;lt;/strong&amp;gt; index.php/titre_du_billet&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;DotClear 2 standard :&lt;/strong&gt; &amp;lt;/strong&amp;gt; index.php/post/annee/mois/jour/titre_du_billet&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;DotClear 2 LLaumgui :&lt;/strong&gt;&amp;lt;/strong&amp;gt; /post/titre_du_billet&lt;/li&gt;
&lt;/ul&gt;


&lt;h2&gt;But de l'opération :&lt;/h2&gt;

&lt;p&gt;Le but est de rediriger les urls de type &lt;em&gt;index.php/titre_du_billet&lt;/em&gt; vers &lt;em&gt;post/titre_du_billet&lt;/em&gt;.
Attention cependant aux pages spéciales de DotClear telles que les archives ou les catégories de billets.&lt;/p&gt;



&lt;h2&gt;L'.htaccess expliqué :&lt;/h2&gt;

&lt;code class=&quot;apache&quot;&gt;&lt;span style=&quot;color: #00007f;&quot;&gt;RewriteEngine&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;On&lt;/span&gt;&lt;/code&gt;

&lt;p&gt;Activation de la réécriture des urls.&lt;/p&gt;

&lt;code class=&quot;apache&quot;&gt;&lt;span style=&quot;color: #adadad; font-style: italic;&quot;&gt;# Redirection sur le www :&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #adadad; font-style: italic;&quot;&gt;#&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #00007f;&quot;&gt;RewriteCond&lt;/span&gt; %&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;HTTP_HOST&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt; !^www.llaumgui.com$&lt;br /&gt;
&lt;span style=&quot;color: #00007f;&quot;&gt;RewriteRule&lt;/span&gt; ^&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;.*&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &amp;nbsp; http://www.llaumgui.com/$&lt;span style=&quot;color: #ff0000;&quot;&gt;1&lt;/span&gt; &amp;nbsp;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#91;&lt;/span&gt;QSA,L,R=&lt;span style=&quot;color: #ff0000;&quot;&gt;301&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#93;&lt;/span&gt;&lt;/code&gt;

&lt;p&gt;On redirige les urls &lt;em&gt;llaumgui.com&lt;/em&gt; vers &lt;em&gt;www.llaumgui&lt;/em&gt;. On ne référence ainsi qu'un seul nom de domaine.&lt;/p&gt;

&lt;code class=&quot;apache&quot;&gt;&lt;span style=&quot;color: #adadad; font-style: italic;&quot;&gt;####&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #adadad; font-style: italic;&quot;&gt;# Vielles URL DC1 :&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #adadad; font-style: italic;&quot;&gt;# Vieux RSS :&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #00007f;&quot;&gt;Redirect&lt;/span&gt; permanent /rss.php http://www.llaumgui.com/feed/rss2&lt;br /&gt;
&lt;span style=&quot;color: #00007f;&quot;&gt;Redirect&lt;/span&gt; permanent /atom.php http://www.llaumgui.com/feed/atom&lt;/code&gt;

&lt;p&gt;Redirection des anciennes urls des feeds.&lt;/p&gt;

&lt;code class=&quot;apache&quot;&gt;&lt;span style=&quot;color: #adadad; font-style: italic;&quot;&gt;# Vielle TOC :&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #00007f;&quot;&gt;RedirectMatch&lt;/span&gt; permanent /index.php/toc&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;.*&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;$ http://www.llaumgui.com/archive&lt;/code&gt;

&lt;p&gt;On redirige l'ancien plugin de &amp;lt;em&amp;gt;Table des matières&amp;lt;/em&amp;gt; vers les archives de DotClear 2.0&lt;/p&gt;

&lt;code class=&quot;apache&quot;&gt;&lt;span style=&quot;color: #adadad; font-style: italic;&quot;&gt;# Vieux billets :&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #00007f;&quot;&gt;RewriteCond&lt;/span&gt; %&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;REQUEST_URI&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt; !^/index\.php\/?$&lt;br /&gt;
&lt;span style=&quot;color: #00007f;&quot;&gt;RewriteCond&lt;/span&gt; %&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;REQUEST_URI&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt; !^/index\.php/archive&lt;br /&gt;
&lt;span style=&quot;color: #00007f;&quot;&gt;RewriteCond&lt;/span&gt; %&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;REQUEST_URI&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt; !^/index\.php/category&lt;br /&gt;
&lt;span style=&quot;color: #00007f;&quot;&gt;RewriteCond&lt;/span&gt; %&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;REQUEST_URI&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt; !^/index\.php/feed&lt;br /&gt;
&lt;span style=&quot;color: #00007f;&quot;&gt;RewriteCond&lt;/span&gt; %&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;REQUEST_URI&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt; !^/index\.php/page&lt;br /&gt;
&lt;span style=&quot;color: #00007f;&quot;&gt;RewriteCond&lt;/span&gt; %&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;REQUEST_URI&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt; !^/index\.php/post&lt;br /&gt;
&lt;span style=&quot;color: #00007f;&quot;&gt;RewriteCond&lt;/span&gt; %&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;REQUEST_URI&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt; !^/index\.php/tag&lt;br /&gt;
&lt;span style=&quot;color: #00007f;&quot;&gt;RewriteCond&lt;/span&gt; %&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;REQUEST_URI&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt; !^/index\.php/tags&lt;br /&gt;
&lt;span style=&quot;color: #00007f;&quot;&gt;RewriteRule&lt;/span&gt; index.php/&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;.*&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; http://www.llaumgui.com/post/$&lt;span style=&quot;color: #ff0000;&quot;&gt;1&lt;/span&gt; &amp;nbsp;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#91;&lt;/span&gt;QSA,L,R=&lt;span style=&quot;color: #ff0000;&quot;&gt;301&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#93;&lt;/span&gt;&lt;/code&gt;

&lt;p&gt;On redirige les urls de type &amp;lt;em&amp;gt;index.php/titre_du_billet&amp;lt;/em&amp;gt; en tenant compte des pages spéciales de DotClear :archives, catégories de billets, etc...&lt;/p&gt;

&lt;code class=&quot;apache&quot;&gt;&lt;span style=&quot;color: #adadad; font-style: italic;&quot;&gt;# Disparition du index.php&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #adadad; font-style: italic;&quot;&gt;#Exécution des fichiers en PHP5&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #00007f;&quot;&gt;AddType&lt;/span&gt; x-mapp-php5 .php&lt;br /&gt;
&lt;span style=&quot;color: #adadad; font-style: italic;&quot;&gt;#Indication du répertoire racine pour la réécriture&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #00007f;&quot;&gt;RewriteBase&lt;/span&gt; /&lt;br /&gt;
&lt;span style=&quot;color: #adadad; font-style: italic;&quot;&gt;#Pas de réécriture si le fichier (-f, file) ou le dossier (-d, directory) existe&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #00007f;&quot;&gt;RewriteCond&lt;/span&gt; %&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;REQUEST_FILENAME&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt; !-f &lt;br /&gt;
&lt;span style=&quot;color: #00007f;&quot;&gt;RewriteCond&lt;/span&gt; %&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;REQUEST_FILENAME&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt; !-d&lt;br /&gt;
&lt;span style=&quot;color: #adadad; font-style: italic;&quot;&gt;#Passage de la page demandée entière sur le index.php/&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #00007f;&quot;&gt;RewriteRule&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;.*&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; index.php/$&lt;span style=&quot;color: #ff0000;&quot;&gt;1&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #adadad; font-style: italic;&quot;&gt;#Redirige index.php vers index.php/ pour éviter les 404 de DC&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #00007f;&quot;&gt;RewriteRule&lt;/span&gt; ^index.php$ &amp;nbsp;index.php/&lt;br /&gt;
&lt;span style=&quot;color: #adadad; font-style: italic;&quot;&gt;#Redirige vers index.php/ si on demande pas de page spécifique&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #00007f;&quot;&gt;DirectoryIndex&lt;/span&gt; index.php&lt;/code&gt;

&lt;p&gt;On passe d'urls standards de type &lt;em&gt;index.php/post/titre_du_billet&lt;/em&gt; vers un format sans index.php : &lt;em&gt;/post/nom_du_billet&lt;/em&gt;.&lt;/p&gt;</description>
    
          <enclosure url="http://www.llaumgui.com/public/files/config/llaumguidotcom_.htaccess"
      length="1175" type="text/plain" />
    
    
          <comments>http://www.llaumgui.com/post/DotClear-20-et-les-redirections-durl#comment-form</comments>
      <wfw:comment>http://www.llaumgui.com/post/DotClear-20-et-les-redirections-durl#comment-form</wfw:comment>
      <wfw:commentRss>http://www.llaumgui.com/feed/atom/comments/83</wfw:commentRss>
      </item>
    
</channel>
</rss>