<?xml version="1.0" encoding="UTF-8"?> <rss
version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:wfw="http://wellformedweb.org/CommentAPI/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
><channel><title>Web Design &#187; htaccess</title> <atom:link href="http://patjack.co.uk/tag/htaccess/feed/" rel="self" type="application/rss+xml" /><link>http://patjack.co.uk</link> <description>Patrick Robertson</description> <lastBuildDate>Sun, 29 Apr 2012 09:13:21 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.3.1</generator> <item><title>Shortening URLs in-house</title><link>http://patjack.co.uk/shortening-urls-in-house/</link> <comments>http://patjack.co.uk/shortening-urls-in-house/#comments</comments> <pubDate>Thu, 27 May 2010 21:21:01 +0000</pubDate> <dc:creator>Patrick</dc:creator> <category><![CDATA[SEO]]></category> <category><![CDATA[Web Design]]></category> <category><![CDATA[google]]></category> <category><![CDATA[htaccess]]></category> <category><![CDATA[html]]></category> <category><![CDATA[php]]></category><guid
isPermaLink="false">http://patjack.co.uk/?p=427</guid> <description><![CDATA[All websites now use URL extensions that redirect for easy to remember URLs. A recent example is Google&#8217;s http://google.com/pacman &#8211; a simple / and one word is much easier to remember than say /google_pacman.html (which is still keeping it simple!) (I&#8217;m sure if you looked into it, the files aren&#8217;t actually stored in a /pacman [...]]]></description> <content:encoded><![CDATA[<p>All websites now use URL extensions that redirect for easy to remember URLs.</p><p>A recent example is Google&#8217;s <a
href="http://google.com/pacman">http://google.com/pacman</a> &#8211; a simple / and one word is much easier to remember than say /google_pacman.html (which is still keeping it simple!)<br
/> (I&#8217;m sure if you looked into it, the files aren&#8217;t actually stored in a /pacman folder either <img
src='http://patjack.co.uk/wp/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> )</p><p>There <em>are</em> URL shortening methods out there, such as <a
href="http://bit.ly">http://bit.ly</a> and <a
href="http://tiny.cc">http://tiny.cc</a>, but I feel these don&#8217;t give you enough power for customisation. And what if you have your own domain that you want to use?!<br
/> <span
id="more-427"></span><br
/> I&#8217;ve made my own simple &#8216;Redirect Setup Script&#8217; that enables you to create redirects with the click of a button.<br
/> You can view a demo here: <a
href="http://patjack.co.uk/newurls">http://patjack.co.uk/newurls</a> (note this doesn&#8217;t actually set up any redirects on my site <img
src='http://patjack.co.uk/wp/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> ) and see how easy it is.</p><p>My method uses PHP that appends the redirect to your root .htaccess file, and uses mod_rewrite. An alternative method would be to use a meta redirect, which I&#8217;ve included in the downloadable folder for those that might not have mod_rewrite on their servers. The downside to the meta redirect is that you need to actually create the folder and index.html file, the .htaccess method just uses the root .htaccess file.</p><p>To swap between using the .htaccess mod_rewrite method and the meta re-direct method, just open up &#8216;process.php&#8217; and change the $use_htaccess from <span
style="color: #33d019;">TRUE</span> to <span
style="color: #ff0000;">FALSE</span>.</p><p>The script also uses REGEX to make sure you don&#8217;t use some silly extension, or input an invalid URL.</p><p>To use, just download the folder from <a
href="http://patjack.co.uk/files/redirect_script.zip">here</a></p><h3>A quick example</h3><p>I&#8217;ve set up a redirect for when I have a chocolate cake craving but don&#8217;t want to bake a whole cake. To see my secret, click through to <a
href="http://patjack.co.uk/cake">http://patjack.co.uk/cake</a>. Mmmmm&#8230;</p><p>Download: <a
href="http://patjack.co.uk/files/redirect_script.zip">Script.zip</a></p><p>Here&#8217;s what gets appended to your root .htaccess and the index.html files respectively</p><h4>.htaccess</h4><p><code><br
/> RedirectMatch /".$_YOUR_EXTENSION."/.* ".$_URL_GOES_HERE." [R=301,L]<br
/> RedirectMatch /".$_YOUR_EXTENSION." ".$_URL_GOES_HERE." [R=301,L]";<br
/> </code><br
/> There&#8217;s a need for two redirects to catch both cases where you may browse to example.com/extension (with no slash) example.com/extension/ (with a slash) or anything else &#8211; example.com/extension/index.html</p><h4>index.html</h4><p><code><br
/> &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;<br
/> &lt;head&gt;<br
/> &lt;title&gt;Redirect&lt;/title&gt;<br
/> &lt;meta http-equiv="refresh" content="0;URL=$_URL_GOES_HERE" /&gt;<br
/> &lt;/head&gt;<br
/> &lt;body&gt;<br
/> &lt;/body&gt;<br
/> &lt;/html&gt;<br
/> </code></p> ]]></content:encoded> <wfw:commentRss>http://patjack.co.uk/shortening-urls-in-house/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> </channel> </rss>
<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic
Page Caching using disk: enhanced (User agent is rejected)

Served from: patjack.co.uk @ 2012-05-19 12:39:57 -->
