Drupal: Copying a site to a test site (subdirectory). The links, they go nowhere!
So I followed Drupal's
Copying your live site to a test site documentation.
My original site is http://foo.com, and my test site is http://foo.com/test/
I've done the following:
- copied the contents of public/ to public/test/
- 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
- I'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.
I'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's the interesting part... in the page not found page, all the links are from the main site, not the test site.
I wonder if .htaccess has something to do with it. I don't know much about it but here's what's in the .htaccess in public/ :
<IfModule mod_rewrite.c>
RewriteEngine on
# Rewrite current-style URLs of the form 'index.php?q=x'.
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
</IfModule>
I should also mention that I'm using clean urls and Drupal 5.5.
Add this line:
RewriteCond %{REQUEST_URI} !^/(test|test/.*)$before the RewriteRule.posted by zsazsa at 2:04 PM on April 10, 2008