<?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: Drupal and the missing links.</title>
      <link>http://ask.metafilter.com/88461/Drupal-and-the-missing-links/</link>
      <description>Comments on Ask MetaFilter post Drupal and the missing links.</description>
	  	  <pubDate>Thu, 10 Apr 2008 14:04:58 -0800</pubDate>
      <lastBuildDate>Thu, 10 Apr 2008 14:04:58 -0800</lastBuildDate>
      <language>en-us</language>
	  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
	  <ttl>60</ttl>

<item>
  	<title>Question: Drupal and the missing links.</title>
  	<link>http://ask.metafilter.com/88461/Drupal-and-the-missing-links</link>	
  	<description>Drupal:  Copying a site to a test site (subdirectory).  The links, they go nowhere! So I followed Drupal&apos;s &lt;a href=&quot;http://drupal.org/upgrade/copying-your-site-via-GUI&quot;&gt;Copying your live site to a test site&lt;/a&gt; documentation.  &lt;br&gt;
&lt;br&gt;
My original site is http://foo.com, and my test site is http://foo.com/test/&lt;br&gt;
&lt;br&gt;
I&apos;ve done the following:&lt;br&gt;
 - copied the contents of public/ to public/test/&lt;br&gt;
 - done an export of the DB, changed the contents of the export so that any reference to foo.com/ now says  foo.com/test/ and done an import to a new DB&lt;br&gt;
 - I&apos;ve added public/sites/foo.com.test/setup.php that points to the new db_url and has foo.com/test as a base_url.  &lt;br&gt;
&lt;br&gt;
I&apos;m able to access the main page of the test site, and when I mouse over a url it will show foo.com/test/example/ but when I click on it, I get a Page Not Found message, but within the drupal theme.  Here&apos;s the interesting part... in the page not found page, all the links are from the main site, not the test site.&lt;br&gt;
&lt;br&gt;
I wonder if .htaccess has something to do with it.  I don&apos;t know much about it but here&apos;s what&apos;s in the .htaccess in  public/ : &lt;br&gt;
&lt;br&gt;
&amp;lt;IfModule mod_rewrite.c&amp;gt;&lt;br&gt;
  RewriteEngine on&lt;br&gt;
  # Rewrite current-style URLs of the form &apos;index.php?q=x&apos;.&lt;br&gt;
  RewriteCond %{REQUEST_FILENAME} !-f&lt;br&gt;
  RewriteCond %{REQUEST_FILENAME} !-d&lt;br&gt;
  RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]&lt;br&gt;
&amp;lt;/IfModule&amp;gt;&lt;br&gt;
&lt;br&gt;
I should also mention that I&apos;m using clean urls and Drupal 5.5.</description>
  	<guid isPermaLink="false">post:ask.metafilter.com,2008:site.88461</guid>
  	<pubDate>Thu, 10 Apr 2008 13:48:32 -0800</pubDate>
  	<dc:creator>Null Pointer and the Exceptions</dc:creator>
	
	<category>drupal</category>
	
	<category>subdomain</category>
	
	<category>subdirectory</category>
	
	<category>htaccess</category>
	
</item>
<item>
  	<title>By: zsazsa</title>
  	<link>http://ask.metafilter.com/88461/Drupal-and-the-missing-links#1301898</link>	
  	<description>That .htaccess enables clean urls for anything under foo.com, which also eats up anything under foo.com/test. You need to exclude /test from rewriting.&lt;br&gt;
&lt;br&gt;
Add this line:&lt;pre&gt;RewriteCond %{REQUEST_URI} !^/(test|test/.*)$&lt;/pre&gt;before the &lt;tt&gt;RewriteRule&lt;/tt&gt;.</description>
  	<guid isPermaLink="false">comment:ask.metafilter.com,2008:site.88461-1301898</guid>
  	<pubDate>Thu, 10 Apr 2008 14:04:58 -0800</pubDate>
  	<dc:creator>zsazsa</dc:creator>
</item>
<item>
  	<title>By: bricoleur</title>
  	<link>http://ask.metafilter.com/88461/Drupal-and-the-missing-links#1301914</link>	
  	<description>Yeah, I think you might need to put something like &lt;br&gt;
&lt;code&gt;&lt;br&gt;
  RewriteCond %{REQUEST_FILENAME} !-f&lt;br&gt;
  RewriteCond %{REQUEST_FILENAME} !-d&lt;br&gt;
  RewriteCond %{REQUEST_URI} ^/test/.*&lt;br&gt;
  RewriteRule ^(.*)$ /test/index.php?q=$1 [L,QSA]&lt;br&gt;
&lt;/code&gt;&lt;br&gt;
before the rules you&apos;ve cited. I think zsazsa&apos;s way might not work if you want clean urls on the test site too.&lt;br&gt;
&lt;br&gt;
And I don&apos;t think you need that public/sites/foo.com.test/settings.php in there; Drupal will be looking at /public/test/sites/default/settings.php</description>
  	<guid isPermaLink="false">comment:ask.metafilter.com,2008:site.88461-1301914</guid>
  	<pubDate>Thu, 10 Apr 2008 14:15:09 -0800</pubDate>
  	<dc:creator>bricoleur</dc:creator>
</item>
<item>
  	<title>By: fishfucker</title>
  	<link>http://ask.metafilter.com/88461/Drupal-and-the-missing-links#1302000</link>	
  	<description>With mod_rewrite it&apos;s much easier (IMHO) to add a &lt;a href=&quot;http://httpd.apache.org/docs/2.2/mod/mod_rewrite.html#rewritebase&quot;&gt;RewriteBase&lt;/a&gt;, like so: &lt;br&gt;
&lt;br&gt;
&lt;pre&gt;&lt;br&gt;
RewriteEngine on&lt;br&gt;
&lt;b&gt;RewriteBase /test&lt;/b&gt;&lt;br&gt;
# Rewrite current-style URLs of the form &apos;index.php?q=x&apos;.&lt;br&gt;
RewriteCond %{REQUEST_FILENAME} !-f&lt;br&gt;
RewriteCond %{REQUEST_FILENAME} !-d&lt;br&gt;
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]&lt;br&gt;
... etc ...&lt;br&gt;
&lt;/pre&gt;&lt;br&gt;
&lt;br&gt;
Other possible culprits:&lt;br&gt;
&lt;br&gt;
1. Your template has hardcoded links to your old domain instead of using the proper Drupal base_url variable. BAD designer, no cookie. (If this is the case, your css probably has the same problem in url() statements). &lt;br&gt;
2. make sure no-one hardcoded a base_url in the sites/default/settings.php file. &lt;br&gt;
&lt;br&gt;
I find it helps to do a &lt;br&gt;
&lt;pre&gt;&lt;br&gt;
grep -r &apos;youroldsitedomain.com&apos; * &lt;br&gt;
&lt;/pre&gt;&lt;br&gt;
&lt;br&gt;
in your root drupal path (VERY IMPORTANT unless you want to take forever by searching through your entire server&apos;s files) to find instances you might have missed. You can actually also grep your database directory and locate tables that contain the strings too (although in your case, since the domain is similar this probably won&apos;t be super useful).</description>
  	<guid isPermaLink="false">comment:ask.metafilter.com,2008:site.88461-1302000</guid>
  	<pubDate>Thu, 10 Apr 2008 15:10:21 -0800</pubDate>
  	<dc:creator>fishfucker</dc:creator>
</item>
<item>
  	<title>By: fishfucker</title>
  	<link>http://ask.metafilter.com/88461/Drupal-and-the-missing-links#1302003</link>	
  	<description>&lt;i&gt;I&apos;m able to access the main page of the test site&lt;/i&gt;&lt;br&gt;
&lt;br&gt;
oh yeah, for sure this is a rewrite problem then. &lt;br&gt;
&lt;br&gt;
(also, &apos;culprits&apos; was probably the wrong word to use above; bad template links are unlikely to give you a 404 on your test site -- but those are additional issues you might face, and might explain why some links have an incorrect target.)</description>
  	<guid isPermaLink="false">comment:ask.metafilter.com,2008:site.88461-1302003</guid>
  	<pubDate>Thu, 10 Apr 2008 15:12:13 -0800</pubDate>
  	<dc:creator>fishfucker</dc:creator>
</item>
<item>
  	<title>By: Null Pointer and the Exceptions</title>
  	<link>http://ask.metafilter.com/88461/Drupal-and-the-missing-links#1302034</link>	
  	<description>The mod rewrite suggestion posted by bricoleur &lt;a href=&quot;http://ask.metafilter.com/88461/Drupal-and-the-missing-links#1301914&quot;&gt;here&lt;/a&gt; helped a little.  Now pages beyond the main page are still marked as not found, but at least on the &amp;quot;page not found&amp;quot; page the urls are all good.&lt;br&gt;
&lt;br&gt;
I&apos;m also able to log in, but it can&apos;t find any pages after that.&lt;br&gt;
&lt;br&gt;
I had already done a grep and nothing is hardcoded as far as paths go, and base_url is not set for the main site.&lt;br&gt;
&lt;br&gt;
Any other suggestions?</description>
  	<guid isPermaLink="false">comment:ask.metafilter.com,2008:site.88461-1302034</guid>
  	<pubDate>Thu, 10 Apr 2008 15:46:53 -0800</pubDate>
  	<dc:creator>Null Pointer and the Exceptions</dc:creator>
</item>
<item>
  	<title>By: fishfucker</title>
  	<link>http://ask.metafilter.com/88461/Drupal-and-the-missing-links#1302107</link>	
  	<description>Add a &lt;br&gt;
&lt;br&gt;
print $_GET[&apos;q&apos;]; &lt;br&gt;
&lt;br&gt;
to your index.php file so you can see what IS getting passed to the query.&lt;br&gt;
&lt;br&gt;
If it&apos;s the correct path, perhaps you have a diff problem (maybe one with the path module)</description>
  	<guid isPermaLink="false">comment:ask.metafilter.com,2008:site.88461-1302107</guid>
  	<pubDate>Thu, 10 Apr 2008 17:03:35 -0800</pubDate>
  	<dc:creator>fishfucker</dc:creator>
</item>
<item>
  	<title>By: eafarris</title>
  	<link>http://ask.metafilter.com/88461/Drupal-and-the-missing-links#1302144</link>	
  	<description>nthing manipulating the &lt;code&gt;RewriteBase&lt;/code&gt; line in your &lt;code&gt;.htaccess&lt;/code&gt; file. The issue is intimately related to Clean URLs. You should be able to test this by using the &apos;non-clean&apos; URLs for a bit -- or example, trying http://www.example.com/test/?q=admin/settings/clean-urls and turning them off.</description>
  	<guid isPermaLink="false">comment:ask.metafilter.com,2008:site.88461-1302144</guid>
  	<pubDate>Thu, 10 Apr 2008 18:01:47 -0800</pubDate>
  	<dc:creator>eafarris</dc:creator>
</item>
<item>
  	<title>By: Null Pointer and the Exceptions</title>
  	<link>http://ask.metafilter.com/88461/Drupal-and-the-missing-links#1302170</link>	
  	<description>eafarris for the win!  Well almost.  You&apos;re right, once I disable clean urls then everything works fine.  Now it won&apos;t let me reactivate clean urls for the foo.com/test/ instance.  Still, this progress is good.</description>
  	<guid isPermaLink="false">comment:ask.metafilter.com,2008:site.88461-1302170</guid>
  	<pubDate>Thu, 10 Apr 2008 18:44:42 -0800</pubDate>
  	<dc:creator>Null Pointer and the Exceptions</dc:creator>
</item>
<item>
  	<title>By: eafarris</title>
  	<link>http://ask.metafilter.com/88461/Drupal-and-the-missing-links#1302190</link>	
  	<description>Now, you need to manipulate the &lt;code&gt;RewriteBase&lt;/code&gt;, probably to &lt;br&gt;
&lt;pre&gt;RewriteBase /test&lt;/pre&gt;&lt;br&gt;
The &lt;code&gt;.htaccess&lt;/code&gt; that comes with Drupal should be fine, with the change above. As long as your Apache installation has &lt;code&gt;mod_rewrite&lt;/code&gt; loaded you should be ok.</description>
  	<guid isPermaLink="false">comment:ask.metafilter.com,2008:site.88461-1302190</guid>
  	<pubDate>Thu, 10 Apr 2008 19:02:36 -0800</pubDate>
  	<dc:creator>eafarris</dc:creator>
</item>
<item>
  	<title>By: Null Pointer and the Exceptions</title>
  	<link>http://ask.metafilter.com/88461/Drupal-and-the-missing-links#1304272</link>	
  	<description>Once I disabled clean urls, added the rewrite Base to a .htaccess within the site, and then re-enabled clean urls everything was perfect.</description>
  	<guid isPermaLink="false">comment:ask.metafilter.com,2008:site.88461-1304272</guid>
  	<pubDate>Sun, 13 Apr 2008 11:36:20 -0800</pubDate>
  	<dc:creator>Null Pointer and the Exceptions</dc:creator>
</item>

    </channel>
</rss>
