<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"
    xmlns:dc="http://purl.org/dc/elements/1.1/"
     xmlns:admin="http://webns.net/mvcb/"
     xmlns:content="http://purl.org/rss/1.0/modules/content/"
     xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
	<channel> 

	<title>Comments on: Why do links to anchor tags in my pages turn the # into %35, and thus break?</title>
	<link>http://ask.metafilter.com/16475/Why-do-links-to-anchor-tags-in-my-pages-turn-the-into-35-and-thus-break/</link>
	<description>Comments on Ask MetaFilter post Why do links to anchor tags in my pages turn the # into %35, and thus break?</description>
	<pubDate>Fri, 18 Mar 2005 06:43:12 -0800</pubDate>
	<lastBuildDate>Fri, 18 Mar 2005 06:43:12 -0800</lastBuildDate>
	<language>en-us</language>
	<docs>http://blogs.law.harvard.edu/tech/rss</docs>
	<ttl>60</ttl>

	<item>
		<title>Question: Why do links to anchor tags in my pages turn the # into %35, and thus break?</title>
		<link>http://ask.metafilter.com/16475/Why-do-links-to-anchor-tags-in-my-pages-turn-the-into-35-and-thus-break</link>	
		<description>Why do links in my anchor tags turn the # into %35 and thus break? Any idea why - and (most importantly) how to fix it. (yeah, I know I should scrap this cumbersome system and move to WordPress - it&apos;s my plan, but I don&apos;t have time at the moment). &lt;br /&gt;&lt;br /&gt; I use a crude system for permalinks: each post on a page has a different anchor. I set up permalinks www.myblog.com/thispost. When I publish, I use control panel 2 to make a permanent redirect, so www.myblog.com/thispost redirects to www.myblog.com/thepage.htm#thispost. This adds a line in my .httaccess file.&lt;br&gt;
&lt;br&gt;
New ones, however, turn up in the browser address bar as %35 instead of the # symbol, and therefore break and 404. (same in IE and Firefox)&lt;br&gt;
&lt;br&gt;
Old ones still work fine. I&apos;ve tried using notepad to copy an old redirect line from httaccess, and just amend it to a new one, but they break too.</description>
		<guid isPermaLink="false">post:ask.metafilter.com,2005:site.16475</guid>
		<pubDate>Fri, 18 Mar 2005 05:23:33 -0800</pubDate>
		<dc:creator>Pericles</dc:creator>
		
			<category>web</category>
		
			<category>internet</category>
		
			<category>characterconversion</category>
		
	</item> <item>
		<title>By: cillit bang</title>
		<link>http://ask.metafilter.com/16475/Why-do-links-to-anchor-tags-in-my-pages-turn-the-into-35-and-thus-break#279008</link>	
		<description>Can you post an actual redirect line from your file?</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2005:site.16475-279008</guid>
		<pubDate>Fri, 18 Mar 2005 06:43:12 -0800</pubDate>
		<dc:creator>cillit bang</dc:creator>
	</item><item>
		<title>By: boaz</title>
		<link>http://ask.metafilter.com/16475/Why-do-links-to-anchor-tags-in-my-pages-turn-the-into-35-and-thus-break#279289</link>	
		<description>Sorry if I&apos;m missing something obvious, but why not just delete the redirects and use the URLs with the fragment identifier in them as your permalinks?  It may not look as pretty, but the current system sounds like a name collision waiting to happen even when it works.</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2005:site.16475-279289</guid>
		<pubDate>Fri, 18 Mar 2005 11:53:12 -0800</pubDate>
		<dc:creator>boaz</dc:creator>
	</item><item>
		<title>By: cerebus19</title>
		<link>http://ask.metafilter.com/16475/Why-do-links-to-anchor-tags-in-my-pages-turn-the-into-35-and-thus-break#279342</link>	
		<description>Are you editing the HTML yourself, in Notepad or some other text editor, or are you using an HTML editor of some kind?  If the latter, it seems like it&apos;s doing a URL encoding on it.  If not, and the anchor tag in the page is being saved with the # in it, I can&apos;t imagine why (or where, for that matter) it would be getting encoded.</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2005:site.16475-279342</guid>
		<pubDate>Fri, 18 Mar 2005 12:44:48 -0800</pubDate>
		<dc:creator>cerebus19</dc:creator>
	</item><item>
		<title>By: Pericles</title>
		<link>http://ask.metafilter.com/16475/Why-do-links-to-anchor-tags-in-my-pages-turn-the-into-35-and-thus-break#279363</link>	
		<description>Here&apos;s a &quot;permalink&quot; that works (not linked, so as not to self-link) http://brucelawson.co.uk/xmas satisfactorily resolves to http://brucelawson.co.uk/index.htm#xmas.&lt;br&gt;
The redirect is&lt;br&gt;
&lt;br&gt;
Redirect permanent /xmas http://brucelawson.co.uk/index.htm#xmas&lt;br&gt;
&lt;br&gt;
This redirect http://brucelawson.co.uk/hahk fails, because the browser tries to go to http://brucelawson.co.uk/index.htm%23hahk - which doesn&apos;[t exist. The redirect in .htacces&lt;br&gt;
&lt;br&gt;
Redirect permanent /hahk http://brucelawson.co.uk/index.htm#hahk&lt;br&gt;
&lt;br&gt;
.. so I can&apos;t see why it fails.&lt;br&gt;
&lt;br&gt;
(The reason I don&apos;t use the real url is so that I can move old links from index.htm to archive.htm and change the redirects so that the permalinks don&apos;t die.)</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2005:site.16475-279363</guid>
		<pubDate>Fri, 18 Mar 2005 12:58:37 -0800</pubDate>
		<dc:creator>Pericles</dc:creator>
	</item><item>
		<title>By: Pericles</title>
		<link>http://ask.metafilter.com/16475/Why-do-links-to-anchor-tags-in-my-pages-turn-the-into-35-and-thus-break#279370</link>	
		<description>I&apos;m using Dreamweaver MX2004 or Notepad to  write the html.&lt;br&gt;
&lt;br&gt;
I&apos;m editing Control Panel X to get at my htaccess file.</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2005:site.16475-279370</guid>
		<pubDate>Fri, 18 Mar 2005 13:04:54 -0800</pubDate>
		<dc:creator>Pericles</dc:creator>
	</item><item>
		<title>By: boaz</title>
		<link>http://ask.metafilter.com/16475/Why-do-links-to-anchor-tags-in-my-pages-turn-the-into-35-and-thus-break#279503</link>	
		<description>Both the redirected URLs you posted work fine for me.  (Firefox &amp;amp; Safari on OS X.)</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2005:site.16475-279503</guid>
		<pubDate>Fri, 18 Mar 2005 15:21:34 -0800</pubDate>
		<dc:creator>boaz</dc:creator>
	</item><item>
		<title>By: boaz</title>
		<link>http://ask.metafilter.com/16475/Why-do-links-to-anchor-tags-in-my-pages-turn-the-into-35-and-thus-break#279509</link>	
		<description>I still say you should, at the very least, move your permalinks out of the top level of your namespace.  Then you can just use a single RedirectMatch to do your redirection.   For example, if you changed your permalinks to the form http://brucelawson.co.uk/&lt;b&gt;p/&lt;/b&gt;thispost, then you could replace all your redirect lines with the single line &lt;code&gt;RedirectMatch /p/(.*)$ http://brucelawson.co.uk/index.htm#$1&lt;/code&gt;</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2005:site.16475-279509</guid>
		<pubDate>Fri, 18 Mar 2005 15:27:50 -0800</pubDate>
		<dc:creator>boaz</dc:creator>
	</item><item>
		<title>By: boaz</title>
		<link>http://ask.metafilter.com/16475/Why-do-links-to-anchor-tags-in-my-pages-turn-the-into-35-and-thus-break#279515</link>	
		<description>Whoops, I just tried that RedirectMatch, and that did have the problem you mentioned.  [this is odd]</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2005:site.16475-279515</guid>
		<pubDate>Fri, 18 Mar 2005 15:40:25 -0800</pubDate>
		<dc:creator>boaz</dc:creator>
	</item><item>
		<title>By: spock</title>
		<link>http://ask.metafilter.com/16475/Why-do-links-to-anchor-tags-in-my-pages-turn-the-into-35-and-thus-break#279655</link>	
		<description>The &quot;#&quot; is not processed by the server. It is an illegal character as far as the web server is concerned. The &quot;#&quot; anchor is only processed on the client side (the browser finds the anchor &lt;b&gt;after the page loads&lt;/b&gt;).&lt;br&gt;
&lt;br&gt;
So, basically, I don&apos;t think you can do what you are trying to do (pass an URL &lt;b&gt;with&lt;/b&gt; the # to the server through the .htaccess redirect. The server will ignore everything after (and including the pound sign).&lt;br&gt;
&lt;br&gt;
Put another way: When you click a link that says &quot;http://whatever.com/whatever.html#anchor&quot; the web server looks for the page whatever.html (not a page named &quot;whatever.html#anchor&quot; (cause that page doesn&apos;t exist).  So it is probably trying to URL encode the # character based on your character set or something.&lt;br&gt;
&lt;br&gt;
I&apos;m guessing here, but I can&apos;t find any .htaccess redirect tutorials that tell me how to do what you are trying to do here.</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2005:site.16475-279655</guid>
		<pubDate>Fri, 18 Mar 2005 20:18:05 -0800</pubDate>
		<dc:creator>spock</dc:creator>
	</item><item>
		<title>By: spock</title>
		<link>http://ask.metafilter.com/16475/Why-do-links-to-anchor-tags-in-my-pages-turn-the-into-35-and-thus-break#279659</link>	
		<description>OR guess what:&lt;br&gt;
Comments in .htaccess files begin with the pound sign &apos;#&apos;.   &lt;br&gt;
&lt;br&gt;
When the .htaccess file encounters a # sign it interprets it as the beginning of a comment. Everything from that point on in the line will be ignored.</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2005:site.16475-279659</guid>
		<pubDate>Fri, 18 Mar 2005 20:31:30 -0800</pubDate>
		<dc:creator>spock</dc:creator>
	</item><item>
		<title>By: spock</title>
		<link>http://ask.metafilter.com/16475/Why-do-links-to-anchor-tags-in-my-pages-turn-the-into-35-and-thus-break#279667</link>	
		<description>Which (I think) explains why my previous comment is basically correct.</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2005:site.16475-279667</guid>
		<pubDate>Fri, 18 Mar 2005 20:52:26 -0800</pubDate>
		<dc:creator>spock</dc:creator>
	</item><item>
		<title>By: Pericles</title>
		<link>http://ask.metafilter.com/16475/Why-do-links-to-anchor-tags-in-my-pages-turn-the-into-35-and-thus-break#279725</link>	
		<description>Thanks all. But nothing explains why some of the &quot;permalinks&quot; work. Time to bring forward that move to WordPress, methinks!</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2005:site.16475-279725</guid>
		<pubDate>Sat, 19 Mar 2005 02:33:44 -0800</pubDate>
		<dc:creator>Pericles</dc:creator>
	</item>
	</channel>
</rss>
