Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Yes, it is possible - I run a drupal site at <a href="http://www.blah.net" rel="nofollow noreferrer">http://www.blah.net</a>, and a development/testing one at <a href="http://dev.blah.net" rel="nofollow noreferrer">http://dev.blah.net</a>. They both use the same code, checked out of a shared svn repository, and they both use the same database.</p> <p>This works fine for me, based on the following conditions:</p> <p>The line of your settings.php that defines $base_url needs to be commented out.</p> <p>The line that defines $cookie_domain needs to be replaced with a conditional on the server name, to prevent logins from going freaking crazy.:</p> <pre><code>if(preg_match('/dev/i', $_SERVER['SERVER_NAME'])) { $cookie_domain = 'dev.blah.net'; } else { $cookie_domain = 'www.blah.net'; } </code></pre> <p>While this is all fine for me, that is because my paths map exactly the same way (the drupal apps both sit on the root of the domain). I originally had www.blah.net/dev, but that broke because paths just don't work anymore.</p> <p>Soo, the solution is to make sure the paths map. Do you possibly have sufficient access to implement an Apache VirtualHost on the site you want to test on? If so then you can add a virtualhost entry like this:</p> <pre><code>&lt;VirtualHost dev.blah.net:80&gt; ServerName dev.blah.net ServerAlias blah.net DirectoryIndex index.php #change this to the path to the drupal install DocumentRoot /www/htdocs/ &lt;Directory "/www/htdocs"&gt; ## Allow CGI and Symbolic Links Options +FollowSymLinks +ExecCGI # NOTE - The FileInfo override allows rewrites to work in htaccess files AllowOverride All Order allow,deny Allow from all &lt;/Directory&gt; &lt;/VirtualHost&gt; </code></pre> <p>Another note is that while you can maintain seperate templates and physicall files without any problem, if you change the configuration through the admin panel, those settings are stored in the database, and so will take effect on all installs sharing the database. Blocks are a typical example of this problem, since they are stored on the database.</p> <p>Basically you cannot have two different sets of path mappings for drupal (granted, you might be able to do some insane apache rewrites, but that would get very messy). The virtualhost answer is probably the least painful solution, providing you have sufficient access.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload