<?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/"
xmlns:media="http://search.yahoo.com/mrss/"><channel><title>Yoast &#187; Serverside</title> <atom:link href="http://yoast.com/cat/serverside/feed/" rel="self" type="application/rss+xml" /><link>http://yoast.com</link> <description>Tweaking Websites</description> <lastBuildDate>Wed, 08 Feb 2012 10:16:45 +0000</lastBuildDate> <language>en-US</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.4-alpha-19827</generator> <image><title>Yoast</title> <url>http://yoast.com/wp-content/themes/yoast-v2/images/yoast-logo-rss.png</url><link>http://yoast.com</link> <width>144</width> <height>103</height> <description>Tweaking Websites</description> </image><xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" /> <item><title>Change domain, and warn your visitors</title><link>http://yoast.com/change-domain-name/#utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=change-domain-name</link> <comments>http://yoast.com/change-domain-name/#comments</comments> <pubDate>Wed, 09 Jun 2010 08:25:32 +0000</pubDate> <dc:creator>Joost de Valk</dc:creator> <category><![CDATA[Serverside]]></category> <category><![CDATA[Hosting]]></category><guid
isPermaLink="false">http://yoast.com/?p=2416</guid> <description><![CDATA[<p>When you change domains, for instance using my moving WordPress to a new domain guide, you'll usually redirect your visitors with something looking like this: The only issue with this is that people might not notice that you've moved to a new domain, and thus might not update their links to you. As Matt Cutts [...]</p><p><a
href="http://yoast.com/change-domain-name/">Change domain, and warn your visitors</a> is a post by <a
rel="author" href="http://yoast.com/author/admin/">Joost de Valk</a> on <a
href="http://yoast.com">Yoast - Tweaking Websites</a>.A good WordPress blog needs good hosting, you don't want your blog to be slow, or, even worse, down, do you? Check out my thoughts on <a
href="http://yoast.com/wordpress-hosting/">WordPress hosting</a>!</p>]]></description> <content:encoded><![CDATA[<p>When you change domains, for instance using my <a
href="http://yoast.com/move-wordpress-blog-domain-10-steps/">moving WordPress to a new domain</a> guide, you'll usually redirect your visitors with something looking like this:</p><pre class="brush: plain; title: ; notranslate">Redirect 301 / http://new.example.com/﻿</pre><p>The only issue with this is that people might not notice that you've moved to a new domain, and thus might not update their links to you. As <a
href="http://www.mattcutts.com/">Matt Cutts</a> confirmed a while back that <a
href="http://searchengineland.com/cutts-redirects-dont-pass-full-pagerank-more-takeaways-38064">301 redirects do not pass full PageRank</a>, and they seem to take a hell of a time to kick in these days, that's somewhat of an issue: we'd rather have people update their links.</p><h2 id="proper-redirect">The proper redirect</h2><p>So we want to tell people that you've moved to a new domain, but only people who came through <em>old</em> links to your site. And we still want to keep that 301 redirect in place, to preserve as much of the value from the old site as we can.</p><p>So, what if we redirected to <code>http://new.example.com/#moved</code>? The search engines don't care about anything from the hash onwards, so the value of the redirect would still be maintained. We could then use javascript to detect the value of the hash tag, and display a notice to our visitors.</p><p>There's an issue with that as well though: with the <code>redirect 301 /</code> line above, we redirected everything after /, to <code>new.example.com/</code>, so for instance <code>/test/</code> would be redirected to <code>new.example.com/test/</code>. If we added <code>#moved</code> to the end of that URL, we would end up with new.example.com/#moved/test/ and that wouldn't work. So we'll need to make a bit of a fancier redirect:</p><pre class="brush: plain; title: ; notranslate">RedirectMatch 301 /(.*)? http://new.example.com/$1#moved</pre></p><p>That should work. Notice though that when you have code in place adding a / to the end of your URL's if not existent, that code should conserve any hash tags in the URL.</p><h2 id="domain-move-message">Showing the domain move message</h2><p>So now, let's move on to the javascript part to actually show people a "we've moved" message, which is actually pretty simple. You create a <code>div</code> with the message you want to show, and put it in your footer, something like this:</p><pre lang="htm">&lt;div id=&quot;domainmovemsg&quot; style=&quot;display:none;&quot;&gt;
  We&#x27;ve moved from old.example.com to new.example.com,
  please update your feeds &amp; links!
&lt;/div&gt;[/code]

As you can see, we default it to <code>display: none;</code> so not everybody sees it, and then you add this tiny snippet of javascript, also in the footer of your page, after you've loaded the <code>div</code> above:
<pre class="brush: jscript; title: ; notranslate">if (document.location.hash == '#moved') {
  document.getElementById('domainmovemsg').style.display = 'block';
}</pre><h2 id="example">Example code</h2><p>I've coded an example of this with some more styling etc., which you can find <a
href="http://yoast.com/code/domain-move/">here</a>. If you want to see it in action immediately, you'll have to click <a
href="http://yoast.com/code/domain-move/#moved">this link</a>.</p><p><a
href="http://yoast.com/change-domain-name/">Change domain, and warn your visitors</a> is a post by <a
rel="author" href="http://yoast.com/author/admin/">Joost de Valk</a> on <a
href="http://yoast.com">Yoast - Tweaking Websites</a>.A good WordPress blog needs good hosting, you don't want your blog to be slow, or, even worse, down, do you? Check out my thoughts on <a
href="http://yoast.com/wordpress-hosting/">WordPress hosting</a>!</p>]]></content:encoded> <wfw:commentRss>http://yoast.com/change-domain-name/feed/</wfw:commentRss> <slash:comments>7</slash:comments> </item> <item><title>Playing around with VPS.net</title><link>http://yoast.com/playing-around-with-vps-net/#utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=playing-around-with-vps-net</link> <comments>http://yoast.com/playing-around-with-vps-net/#comments</comments> <pubDate>Fri, 03 Jul 2009 08:00:53 +0000</pubDate> <dc:creator>Joost de Valk</dc:creator> <category><![CDATA[Serverside]]></category> <category><![CDATA[Hosting]]></category><guid
isPermaLink="false">http://yoast.com/playing-around-with-vps-net/</guid> <description><![CDATA[<p>Update: my WordPress blog is now hosted on VPS.net, check out my article on WordPress Hosting, you'll also read there that I actually use a different image than the one below, though the steps are almost the same. So the guys who run WestHost and provide me with my awesome WordPress hosting, are a sister [...]</p><p><a
href="http://yoast.com/playing-around-with-vps-net/">Playing around with VPS.net</a> is a post by <a
rel="author" href="http://yoast.com/author/admin/">Joost de Valk</a> on <a
href="http://yoast.com">Yoast - Tweaking Websites</a>.A good WordPress blog needs good hosting, you don't want your blog to be slow, or, even worse, down, do you? Check out my thoughts on <a
href="http://yoast.com/wordpress-hosting/">WordPress hosting</a>!</p>]]></description> <content:encoded><![CDATA[<p>Update: my WordPress blog is now hosted on VPS.net, check out my article on <a
href="http://yoast.com/articles/wordpress-hosting/">WordPress Hosting</a>, you'll also read there that I actually use a different image than the one below, though the steps are almost the same.</p><p><a
class="track clicky_log_outbound" href="http://yoast.com/out/vps/"><img
class="alignright size-full wp-image-3176" title="vps.net logo" src="http://cdn3.yoast.com/wp-content/uploads/2009/07/vps.net-logo.gif" alt="" width="186" height="51" /></a>So the guys who run <a
href="http://yoast.com/out/westhost/" target="_blank">WestHost</a> and provide me with my awesome <a
href="http://yoast.com/wordpress-hosting/" target="_blank">WordPress hosting</a>, are a sister company of the guys that run <a
class="track clicky_log_outbound" href="http://yoast.com/out/vps/">VPS.net</a>, and they recently gave me a VPS to play around with a bit. I kinda liked how easy it was to get a VPS up and running with a <a
href="http://www.turnkeylinux.org/appliances/wordpress" target="_blank">TurnKey Linux / WordPress image</a> on it, the only issue was it was version 2.5 and needed updating.</p><p>Though they told me that would be changed pretty soon (meaning the image will support a higher WP version), I made a quick video on how to do all this:</p><p><a
href="http://yoast.com/playing-around-with-vps-net/"><em>Click here to view the embedded video.</em></a></p><p>I have to say it was a pretty nice experience, if you're looking for a VPS, this is pretty much top notch stuff (being a nice combo between a VPS and cloud based hosting) and it isn't expensive.</p><p><a
href="http://yoast.com/playing-around-with-vps-net/">Playing around with VPS.net</a> is a post by <a
rel="author" href="http://yoast.com/author/admin/">Joost de Valk</a> on <a
href="http://yoast.com">Yoast - Tweaking Websites</a>.A good WordPress blog needs good hosting, you don't want your blog to be slow, or, even worse, down, do you? Check out my thoughts on <a
href="http://yoast.com/wordpress-hosting/">WordPress hosting</a>!</p>]]></content:encoded> <wfw:commentRss>http://yoast.com/playing-around-with-vps-net/feed/</wfw:commentRss> <slash:comments>14</slash:comments> <media:content url="http://www.vimeo.com/moogaloop.swf?clip_id=5429890" duration="261"> <media:player url="http://www.vimeo.com/moogaloop.swf?clip_id=5429890" /> <media:title type="html">VPS.net review - Yoast</media:title> <media:description type="html">General review of the VPS.net platforms capabilities, plus a video of playing with the Turnkey linux image on VPS.net.</media:description> <media:thumbnail url="http://cdn2.yoast.com/wp-content/uploads/2012/01/vps-net-review-yoast.jpg" /> <media:keywords>Hosting,vps.net</media:keywords> </media:content> <media:thumbnail url="http://cdn3.yoast.com/wp-content/uploads/2009/07/vps.net-logo-125x51.gif" /> <media:content url="http://cdn3.yoast.com/wp-content/uploads/2009/07/vps.net-logo.gif" medium="image"> <media:title type="html">vps.net logo</media:title> <media:thumbnail url="http://cdn3.yoast.com/wp-content/uploads/2009/07/vps.net-logo-125x51.gif" /> </media:content> </item> <item><title>How to remove www from your URL with mod_rewrite</title><link>http://yoast.com/how-to-remove-www-from-your-url-with-mod_rewrite/#utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=how-to-remove-www-from-your-url-with-mod_rewrite</link> <comments>http://yoast.com/how-to-remove-www-from-your-url-with-mod_rewrite/#comments</comments> <pubDate>Sun, 08 Apr 2007 20:56:17 +0000</pubDate> <dc:creator>Joost de Valk</dc:creator> <category><![CDATA[SEO]]></category> <category><![CDATA[Serverside]]></category> <category><![CDATA[Apache]]></category><guid
isPermaLink="false">http://www.joostdevalk.nl/blog/how-to-remove-www-from-your-url-with-mod_rewrite/</guid> <description><![CDATA[<p>I got a hit today for the following search query: how do you get rid of the www in url. As you can see that hits on my article about removing PHPSESSID's, which isn't quite what the person was looking for I guess. Here's the code to 301 redirect the www version of your site [...]</p><p><a
href="http://yoast.com/how-to-remove-www-from-your-url-with-mod_rewrite/">How to remove www from your URL with mod_rewrite</a> is a post by <a
rel="author" href="http://yoast.com/author/admin/">Joost de Valk</a> on <a
href="http://yoast.com">Yoast - Tweaking Websites</a>.A good WordPress blog needs good hosting, you don't want your blog to be slow, or, even worse, down, do you? Check out my thoughts on <a
href="http://yoast.com/wordpress-hosting/">WordPress hosting</a>!</p>]]></description> <content:encoded><![CDATA[<p>I got a hit today for the following search query: <a
href="http://www.google.com/search?q=how+do+you+get+rid+of+the+www+in+url&amp;start=0">how do you get rid of the www in url</a>. As you can see that hits on my article about <a
href="http://yoast.com/how-to-get-rid-of-phpsessid-in-the-url-and-redirect/">removing PHPSESSID's</a>, which isn't quite what the person was looking for I guess. Here's the code to 301 redirect the www version of your site to the non-www version using Apache's mod_rewrite:</p><pre class="brush: plain; title: ; notranslate">RewriteEngine On
RewriteCond %{HTTP_HOST} ^www.example.com$ [NC]
RewriteRule ^(.*)$ http://example.com/$1 [R=301,L]</pre><h2>Adding the www instead of removing it</h2><p>And, as requested in the comments, the code to <strong>add www</strong> to your domain name:</p><pre class="brush: plain; title: ; notranslate">RewriteEngine On
RewriteCond %{HTTP_HOST} ^example.com$
RewriteRule (.*) http://www.example.com$1 [R=301]</pre><p><a
href="http://yoast.com/how-to-remove-www-from-your-url-with-mod_rewrite/">How to remove www from your URL with mod_rewrite</a> is a post by <a
rel="author" href="http://yoast.com/author/admin/">Joost de Valk</a> on <a
href="http://yoast.com">Yoast - Tweaking Websites</a>.A good WordPress blog needs good hosting, you don't want your blog to be slow, or, even worse, down, do you? Check out my thoughts on <a
href="http://yoast.com/wordpress-hosting/">WordPress hosting</a>!</p>]]></content:encoded> <wfw:commentRss>http://yoast.com/how-to-remove-www-from-your-url-with-mod_rewrite/feed/</wfw:commentRss> <slash:comments>42</slash:comments> </item> <item><title>PHP-APC: Speed up your web applications!</title><link>http://yoast.com/php-apc-speed-web-applications/#utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=php-apc-speed-web-applications</link> <comments>http://yoast.com/php-apc-speed-web-applications/#comments</comments> <pubDate>Sun, 08 Apr 2007 08:08:25 +0000</pubDate> <dc:creator>Joost de Valk</dc:creator> <category><![CDATA[Serverside]]></category> <category><![CDATA[PHP]]></category><guid
isPermaLink="false">http://www.joostdevalk.nl/blog/php-apc-speed-web-appilcations/</guid> <description><![CDATA[<p>As regular readers of this blog might know I have written quite some tools using the different API's of search engines, and always found them quite useful. When I was implementing my sitewide search function, one of the things that bothered me that it was a bit slow. I knew that I had seen some [...]</p><p><a
href="http://yoast.com/php-apc-speed-web-applications/">PHP-APC: Speed up your web applications!</a> is a post by <a
rel="author" href="http://yoast.com/author/admin/">Joost de Valk</a> on <a
href="http://yoast.com">Yoast - Tweaking Websites</a>.A good WordPress blog needs good hosting, you don't want your blog to be slow, or, even worse, down, do you? Check out my thoughts on <a
href="http://yoast.com/wordpress-hosting/">WordPress hosting</a>!</p>]]></description> <content:encoded><![CDATA[<p>As regular readers of this blog might know I have written quite some tools using the different API's of search engines, and always found them quite useful. When I was implementing my <a
href="http://yoast.com/implementing-a-sitewide-search-function/">sitewide search function</a>, one of the things that bothered me that it was a bit slow. I knew that I had seen some caching implementations on the <a
href="http://developer.yahoo.com/php/">Yahoo PHP developer center</a>, but I hadn't bothered up till then to look at them a bit better.</p><p>Now I did, and I found the <a
href="http://developer.yahoo.com/php/samples/cache/cacheAPC.txt">cacheAPC</a> example to be very, very easy. It relies on the <a
href="http://php.net/apc">Alternative PHP Cache</a>, an opcode cache <a
href="http://pecl.php.net/">PECL</a> extension for PHP. I wrote two functions, which I then put in to all my pieces of code which I've published that use a lot of calls to the different API's. The first is <code>curlopen</code>, the function I use to open connections:</p><pre class="brush: plain; title: ; notranslate">function curlopen($request) {
	$ch = curl_init();
	curl_setopt($ch, CURLOPT_URL, $request);
	curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
	curl_setopt($ch, CURLOPT_TIMEOUT, 100);
	curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
	$results = curl_exec ($ch);
	curl_close($ch);
	return $results;
}</pre><p>The second one is the actual cache function, look at how easy it is:</p><pre class="brush: plain; title: ; notranslate">function request_cache($url, $ttl) {
	if(!$doc = apc_fetch($url)) {
		$doc = curlopen($url);
		if ($doc === false) return false;
		apc_store($url,$doc, $ttl);
	}
	return $doc;
}</pre><p>It basically does three things:</p><ol><li>It looks if the requested resource is already in the cache, and if it is, it fetches that;</li><li>If it's not, it opens it through <code>curlopen</code> and stores it in the cache;</li><li>It returns the requested data;</li></ol><p>As you can see the request_cache function takes two parameters: the request url and the <a
href="http://en.wikipedia.org/wiki/Time_to_live">TTL</a>, which, in seconds, determines how long that resource should be cached. Now if you request a PageRank for a URL, it's fairly safe to set this to 24 hours, and you can see how much requests this saves!</p><p><a
href="http://yoast.com/php-apc-speed-web-applications/">PHP-APC: Speed up your web applications!</a> is a post by <a
rel="author" href="http://yoast.com/author/admin/">Joost de Valk</a> on <a
href="http://yoast.com">Yoast - Tweaking Websites</a>.A good WordPress blog needs good hosting, you don't want your blog to be slow, or, even worse, down, do you? Check out my thoughts on <a
href="http://yoast.com/wordpress-hosting/">WordPress hosting</a>!</p>]]></content:encoded> <wfw:commentRss>http://yoast.com/php-apc-speed-web-applications/feed/</wfw:commentRss> <slash:comments>15</slash:comments> </item> <item><title>PHP 301 redirects for Apache and IIS</title><link>http://yoast.com/php-301-redirects-apache-iis/#utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=php-301-redirects-apache-iis</link> <comments>http://yoast.com/php-301-redirects-apache-iis/#comments</comments> <pubDate>Mon, 02 Apr 2007 20:32:04 +0000</pubDate> <dc:creator>Joost de Valk</dc:creator> <category><![CDATA[Serverside]]></category> <category><![CDATA[Apache]]></category> <category><![CDATA[PHP]]></category><guid
isPermaLink="false">http://www.joostdevalk.nl/blog/php-301-redirects-for-apache-and-iis/</guid> <description><![CDATA[<p>This one is just here for my own reference, because the default 302 status code just isn't good enough! PHP 301 for Apache: PHP 301 for IIS:</p><p><a
href="http://yoast.com/php-301-redirects-apache-iis/">PHP 301 redirects for Apache and IIS</a> is a post by <a
rel="author" href="http://yoast.com/author/admin/">Joost de Valk</a> on <a
href="http://yoast.com">Yoast - Tweaking Websites</a>.A good WordPress blog needs good hosting, you don't want your blog to be slow, or, even worse, down, do you? Check out my thoughts on <a
href="http://yoast.com/wordpress-hosting/">WordPress hosting</a>!</p>]]></description> <content:encoded><![CDATA[<p>This one is just here for my own reference, because the default 302 status code just isn't good enough!</p><p>PHP 301 for Apache:</p><pre class="brush: php; title: ; notranslate">header(&quot;HTTP/1.1 301 Moved Permanently&quot;);
header(&quot;Location: http://www.example.com/newpage/&quot;);
exit;</pre><p>PHP 301 for IIS:</p><pre class="brush: php; title: ; notranslate">header(&quot;Status: 301 Moved Permanently&quot;);
header(&quot;Location: http://www.example.com/newpage/&quot;);
exit;</pre><p><a
href="http://yoast.com/php-301-redirects-apache-iis/">PHP 301 redirects for Apache and IIS</a> is a post by <a
rel="author" href="http://yoast.com/author/admin/">Joost de Valk</a> on <a
href="http://yoast.com">Yoast - Tweaking Websites</a>.A good WordPress blog needs good hosting, you don't want your blog to be slow, or, even worse, down, do you? Check out my thoughts on <a
href="http://yoast.com/wordpress-hosting/">WordPress hosting</a>!</p>]]></content:encoded> <wfw:commentRss>http://yoast.com/php-301-redirects-apache-iis/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Convert underscores to dashes with Apache mod_rewrite</title><link>http://yoast.com/apache-rewrite-dash-underscore/#utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=apache-rewrite-dash-underscore</link> <comments>http://yoast.com/apache-rewrite-dash-underscore/#comments</comments> <pubDate>Sun, 25 Mar 2007 15:32:28 +0000</pubDate> <dc:creator>Joost de Valk</dc:creator> <category><![CDATA[Serverside]]></category> <category><![CDATA[Apache]]></category><guid
isPermaLink="false">http://www.joostdevalk.nl/blog/apache-rewrite-dash-underscore/</guid> <description><![CDATA[<p>Update: (Aug 4 2007) the stuff below is no longer necessary, all major search engines now treat underscores and dashes exactly the same, as word separators! A year or so back, I was using underscores in my URL's on this site for spaces, and I decided to switch them to dashes, since several people, including [...]</p><p><a
href="http://yoast.com/apache-rewrite-dash-underscore/">Convert underscores to dashes with Apache mod_rewrite</a> is a post by <a
rel="author" href="http://yoast.com/author/admin/">Joost de Valk</a> on <a
href="http://yoast.com">Yoast - Tweaking Websites</a>.A good WordPress blog needs good hosting, you don't want your blog to be slow, or, even worse, down, do you? Check out my thoughts on <a
href="http://yoast.com/wordpress-hosting/">WordPress hosting</a>!</p>]]></description> <content:encoded><![CDATA[<p><strong>Update:</strong> (Aug 4 2007) the stuff below is no longer necessary, all major search engines now treat underscores and dashes exactly the same, as word separators!</p><p>A year or so back, I was using underscores in my URL's on this site for spaces,  and I decided to switch them to dashes, since several people, including Matt Cutts, had blogged that this was "the way to go". Now at that time I just redirected all old URL's to new ones, which created like 30 lines in my Apache config, something I didn't really like...</p><p>This morning I took the time to find a more elegant solution, and the easiest one I could come up with is the following:</p><pre class="brush: plain; title: ; notranslate">RewriteCond %{REQUEST_URI} ^(.*)_(.*)/$
RewriteRule (.*)_(.*)/ http://yoast.com$1-$2/ [R=301]</pre><p>This will rewrite a single underscore to a single dash, using a 301 redirect. So if you have directories with four underscores, it will go through this rewrite four  times before reaching the final URL. I had some directories in which this was the case, and made sure it only had to redirect a maximum of two times by adding the following lines above it:</p><pre class="brush: plain; title: ; notranslate">RewriteCond %{REQUEST_URI} ^(.*)_(.*)_(.*)/$
RewriteRule (.*)_(.*)_(.*)/ http://yoast.com$1-$2-$3/ [R=301]</pre><p>You could add even more lines like these if need be, I'd make sure that no more than two redirects are needed to rewrite the underscores into dashes.</p><p>The "/" on the end of the RewriteCond is there to make sure this is a directory, and not a file, since I've got quite a few images with underscores in the names and didn't want to bother renaming them.</p><p><a
href="http://yoast.com/apache-rewrite-dash-underscore/">Convert underscores to dashes with Apache mod_rewrite</a> is a post by <a
rel="author" href="http://yoast.com/author/admin/">Joost de Valk</a> on <a
href="http://yoast.com">Yoast - Tweaking Websites</a>.A good WordPress blog needs good hosting, you don't want your blog to be slow, or, even worse, down, do you? Check out my thoughts on <a
href="http://yoast.com/wordpress-hosting/">WordPress hosting</a>!</p>]]></content:encoded> <wfw:commentRss>http://yoast.com/apache-rewrite-dash-underscore/feed/</wfw:commentRss> <slash:comments>1</slash:comments> </item> <item><title>Trailing double forward slashes in URL&#8217;s in the SERPs&#8230;</title><link>http://yoast.com/trailing-double-forward-slashes-in-urls-in-the-serps/#utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=trailing-double-forward-slashes-in-urls-in-the-serps</link> <comments>http://yoast.com/trailing-double-forward-slashes-in-urls-in-the-serps/#comments</comments> <pubDate>Sat, 17 Mar 2007 19:18:36 +0000</pubDate> <dc:creator>Joost de Valk</dc:creator> <category><![CDATA[Serverside]]></category> <category><![CDATA[Apache]]></category><guid
isPermaLink="false">http://www.joostdevalk.nl/blog/trailing-double-forward-slashes-in-urls-in-the-serps/</guid> <description><![CDATA[<p>This query gives a result I hadn't seen before (image), the same page was indexed with both a single trailing forward slash, which is of course normal, and with a double trailing forward slash... This is of course a duplicate content issue, especially when people link to the double slash one by accident. The fix [...]</p><p><a
href="http://yoast.com/trailing-double-forward-slashes-in-urls-in-the-serps/">Trailing double forward slashes in URL&#8217;s in the SERPs&#8230;</a> is a post by <a
rel="author" href="http://yoast.com/author/admin/">Joost de Valk</a> on <a
href="http://yoast.com">Yoast - Tweaking Websites</a>.A good WordPress blog needs good hosting, you don't want your blog to be slow, or, even worse, down, do you? Check out my thoughts on <a
href="http://yoast.com/wordpress-hosting/">WordPress hosting</a>!</p>]]></description> <content:encoded><![CDATA[<p><a
href="http://www.google.com/search?q=site:http://yoast.com/code/greasemonkey/statistics-detector/&amp;hl=en&amp;safe=off&amp;filter=0" target="_blank">This query</a> gives a result I hadn't seen before (<a
href="http://cdn2.yoast.com/wp-content/uploads/2007/03/doubleslash.png" title="double trailing forward slash in Google SERPs">image</a>), the same page was indexed with both a single trailing forward slash, which is of course normal, and with a double trailing forward slash... This is of course a duplicate content issue, especially when people link to the double slash one by accident. The fix for it in Apache is quite easy, just add this to your server config or htaccess:</p><pre class="brush: plain; title: ; notranslate">RewriteEngine On
RewriteCond %{REQUEST_URI} ^(.*)//$
RewriteRule . http://yoast.com%1/ [R=301]</pre><p><a
href="http://yoast.com/trailing-double-forward-slashes-in-urls-in-the-serps/">Trailing double forward slashes in URL&#8217;s in the SERPs&#8230;</a> is a post by <a
rel="author" href="http://yoast.com/author/admin/">Joost de Valk</a> on <a
href="http://yoast.com">Yoast - Tweaking Websites</a>.A good WordPress blog needs good hosting, you don't want your blog to be slow, or, even worse, down, do you? Check out my thoughts on <a
href="http://yoast.com/wordpress-hosting/">WordPress hosting</a>!</p>]]></content:encoded> <wfw:commentRss>http://yoast.com/trailing-double-forward-slashes-in-urls-in-the-serps/feed/</wfw:commentRss> <slash:comments>8</slash:comments> </item> </channel> </rss>
<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using apc
Page Caching using apc
Database Caching 1/37 queries in 0.009 seconds using apc
Object Caching 1351/1415 objects using apc
Content Delivery Network via cdn.yoast.com

Served from: yoast.com @ 2012-02-08 22:23:57 -->
