<?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: YA htaccess Q</title>
	<link>http://ask.metafilter.com/33506/YA-htaccess-Q/</link>
	<description>Comments on Ask MetaFilter post YA htaccess Q</description>
	<pubDate>Tue, 28 Feb 2006 14:48:49 -0800</pubDate>
	<lastBuildDate>Tue, 28 Feb 2006 14:48:49 -0800</lastBuildDate>
	<language>en-us</language>
	<docs>http://blogs.law.harvard.edu/tech/rss</docs>
	<ttl>60</ttl>

	<item>
		<title>Question: YA htaccess Q</title>
		<link>http://ask.metafilter.com/33506/YA-htaccess-Q</link>	
		<description>Another redirect question. &lt;br /&gt;&lt;br /&gt; My wife has just shifted her weblog from a folder on my server to another server. I want anyone who links to: &lt;br&gt;
&lt;br&gt;
http://mysite.com/wife/path/to/file/file.html&lt;br&gt;
&lt;br&gt;
to be automatically redirected to:&lt;br&gt;
&lt;br&gt;
http://wifesite.com/path/to/file/file.html&lt;br&gt;
&lt;br&gt;
Note there are several different paths to files - and this structure will remain identical (for now) on the new server.&lt;br&gt;
&lt;br&gt;
I&apos;ve looked at the other Mod_rewrite and htaccess tagged posts here, and they seem promising, but I can&apos;t get them to work. This is likely because I am an idiot, I know, but please be charitable!</description>
		<guid isPermaLink="false">post:ask.metafilter.com,2006:site.33506</guid>
		<pubDate>Tue, 28 Feb 2006 14:10:35 -0800</pubDate>
		<dc:creator>mikel</dc:creator>
		
			<category>htaccess</category>
		
			<category>redirect</category>
		
			<category>rewrite</category>
		
			<category>www</category>
		
	</item> <item>
		<title>By: frykitty</title>
		<link>http://ask.metafilter.com/33506/YA-htaccess-Q#522279</link>	
		<description>Instead of trying to do it with .htaccess, change the index.php to read:&lt;br&gt;
&lt;br&gt;
&amp;lt;?php&lt;br&gt;
header(&quot;Location: http://wifesite.com/path/to/file/file.html&quot;);&lt;br&gt;
?&amp;gt;&lt;br&gt;
&lt;br&gt;
Just make sure .htaccess has the line:&lt;br&gt;
&lt;br&gt;
DirectoryIndex index.php</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2006:site.33506-522279</guid>
		<pubDate>Tue, 28 Feb 2006 14:48:49 -0800</pubDate>
		<dc:creator>frykitty</dc:creator>
	</item><item>
		<title>By: frykitty</title>
		<link>http://ask.metafilter.com/33506/YA-htaccess-Q#522281</link>	
		<description>Hmm.  That php command is all on one line in my file.  Sorry about that.</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2006:site.33506-522281</guid>
		<pubDate>Tue, 28 Feb 2006 14:49:40 -0800</pubDate>
		<dc:creator>frykitty</dc:creator>
	</item><item>
		<title>By: freudianslipper</title>
		<link>http://ask.metafilter.com/33506/YA-htaccess-Q#522302</link>	
		<description>how about a meta refresh tag? maybe even put a note saying &quot;you will be redirected in 3 seconds, please update your bookmarks&quot; as is pretty standard.&lt;br&gt;
&lt;br&gt;
&lt;a href=&quot;http://webdesign.about.com/cs/metatags/a/aa080300a.htm&quot;&gt;link&lt;/a&gt; to example.</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2006:site.33506-522302</guid>
		<pubDate>Tue, 28 Feb 2006 15:35:10 -0800</pubDate>
		<dc:creator>freudianslipper</dc:creator>
	</item><item>
		<title>By: cillit bang</title>
		<link>http://ask.metafilter.com/33506/YA-htaccess-Q#522307</link>	
		<description>If you have access to httpd.conf:&lt;br&gt;
&lt;br&gt;
	RedirectMatch permanent ^/wife(.+)$ http://www.wifesite.com$1</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2006:site.33506-522307</guid>
		<pubDate>Tue, 28 Feb 2006 15:45:10 -0800</pubDate>
		<dc:creator>cillit bang</dc:creator>
	</item><item>
		<title>By: holloway</title>
		<link>http://ask.metafilter.com/33506/YA-htaccess-Q#522329</link>	
		<description>Meta and PHP won&apos;t catch all pages on the site (unless you&apos;re willing to change all of the pages to have metatags or use this php).&lt;br&gt;
&lt;br&gt;
.htaccess is the best way.&lt;br&gt;
&lt;br&gt;
&lt;small&gt;(Well php could work if you use htaccess to rewrite all /wife traffic to a PHP page with redirect logic in there, but that sounds like much more work)&lt;/small&gt;</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2006:site.33506-522329</guid>
		<pubDate>Tue, 28 Feb 2006 16:06:02 -0800</pubDate>
		<dc:creator>holloway</dc:creator>
	</item><item>
		<title>By: holloway</title>
		<link>http://ask.metafilter.com/33506/YA-htaccess-Q#522330</link>	
		<description>Er, .htaccess or httpd.conf, of course.</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2006:site.33506-522330</guid>
		<pubDate>Tue, 28 Feb 2006 16:06:25 -0800</pubDate>
		<dc:creator>holloway</dc:creator>
	</item><item>
		<title>By: freudianslipper</title>
		<link>http://ask.metafilter.com/33506/YA-htaccess-Q#522647</link>	
		<description>oh i see now why a simple meta refresh won&apos;t exactly work in your case. well if you didn&apos;t get it working perhaps this link would help? &lt;a href=&quot;http://www.javascriptkit.com/howto/htaccess7.shtml&quot;&gt;link&lt;/a&gt;&lt;br&gt;
&lt;br&gt;
so I would think if you did something like this all on one line:&lt;br&gt;
&lt;br&gt;
Redirect http://mysite.com/wife/path/to/file/ http://wifesite.com/path/to/file/file.html&lt;br&gt;
&lt;br&gt;
But I haven&apos;t tested it myself.</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2006:site.33506-522647</guid>
		<pubDate>Tue, 28 Feb 2006 22:42:31 -0800</pubDate>
		<dc:creator>freudianslipper</dc:creator>
	</item><item>
		<title>By: jozxyqk</title>
		<link>http://ask.metafilter.com/33506/YA-htaccess-Q#522717</link>	
		<description>You could also use a 404 trick.  &lt;br&gt;
Put nothing in the /wife directory but an htaccess file with:&lt;br&gt;
&lt;br&gt;
ErrorDocument 404 http://path/to/some/404.cgi&lt;br&gt;
&lt;br&gt;
And your 404 CGI munges up the REQUEST_URI environment variable and spits out a Location header.&lt;br&gt;
&lt;br&gt;
In Perl, it would look something like:&lt;br&gt;
&lt;br&gt;
#!/usr/bin/perl&lt;br&gt;
&lt;br&gt;
$foo = $ENV{REQUEST_URI};&lt;br&gt;
$foo =~ s|^/wife||;&lt;br&gt;
print &quot;Location: http://wifesite.com$foo\n\n&quot;;</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2006:site.33506-522717</guid>
		<pubDate>Wed, 01 Mar 2006 03:42:46 -0800</pubDate>
		<dc:creator>jozxyqk</dc:creator>
	</item><item>
		<title>By: mikel</title>
		<link>http://ask.metafilter.com/33506/YA-htaccess-Q#528542</link>	
		<description>Just a followup cause I know people like that...&lt;br&gt;
&lt;br&gt;
It turns out there was some issue with the hosting company and htaccess files, that&apos;s why it wasn&apos;t working in the first place. I resolved that and the standard &lt;code&gt;redirect fromhere tohere&lt;/code&gt; syntax is perfect.&lt;br&gt;
&lt;br&gt;
I marked that answer best even though that&apos;s what I was trying myself in the first place, but thanks everyone for their contributions.</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2006:site.33506-528542</guid>
		<pubDate>Tue, 07 Mar 2006 10:35:09 -0800</pubDate>
		<dc:creator>mikel</dc:creator>
	</item>
	</channel>
</rss>
