I have a multisite install on my localhost for development.
I used an Alias in Apache like "Alias /gallery /Library/WebServer/Documents/drupal".
I use a folder named localhost.gallery inside the sites folder.
This works fine. However, when I try to turn on clean URLs, drupal instantly pulls up my default site instead of the requested site.
What am I doing wrong? Is there a better way to configure a local multisite install, or a rewrite rule I need to add to the .htaccess file?

Comments

shyamala’s picture

I am also looking for help on clean URL

Shyamala
Team Leader Netlink Technologies Ltd.

buck2769’s picture

C'mon, no one does dev work with multisite install & clean url's on a local machine?

webel’s picture

C'mon, no one does dev work with multisite install & clean url's on a local machine?

Really ? Don't they ? Would I would like to as well. It is sensible request.

Webel IT Australia, "Elements of the Web", Scientific IT Consultancy,
For PHP-driven Drupal CMS web sites, Enterprise Java, graphical UML, UML Parsing Analysis, SysML, XML.

webel’s picture

I need clean URLs for Ubercart, and my rewrite attempts have failed.

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} ^/ubercart/.*
RewriteRule ^(.*)$ /ubercart/index.php?q=$1 [L,QSA]

Please note:

  • Mac OS X 10.5.6
  • I tried symlink from within '/Library/Webserver/Documents/drupal' to 'ubercart', did not work (would not install, fell back to default site)
  • I instead used httpd.conf alias 'Alias /ubercart /Library/WebServer/Documents/drupal', then it picked up the install ok
  • Can only access admin pages through explicit non-clean URLs, and whenever submit if falls back to the default site

VERY glad for help, this is driving me (even) crazy(er).

Webel IT Australia, "Elements of the Web", Scientific IT Consultancy,
For PHP-driven Drupal CMS web sites, Enterprise Java, graphical UML, UML Parsing Analysis, SysML, XML.

WorldFallz’s picture

I do it all the time-- and it doesn't require anything special. However, i usually use the domain name I intend to use on the live site instead of localhost (by adding an entry in the local hosts file). Sometimes I use a subdomain.

The main thing required to get multisites working is to be sure that all the sites are redirected to the main root of the multisite with apache-- not the actual subdirectory of the subsite. If it's a local site you can do it in the httpd.conf file. On shared hosts you won't have access to that so you have to find another way (which will depend on the host).

webel’s picture

@WorldFallz
usually use the domain name I intend to use on the live site instead of localhost (by adding an entry in the local hosts file)
For my example I want to have ubercart.webel.com.au (eventually, remote). How would this look in /etc/hosts
to handle http://localhost/ubercart (currently picks up .../sites/localhost.ubercart ok only for non-clean URLs) ?

And I assume I also have to change locally to .../sites/ubercart.webel.com.au

Grateful,

Webel

Webel IT Australia, "Elements of the Web", Scientific IT Consultancy,
For PHP-driven Drupal CMS web sites, Enterprise Java, graphical UML, UML Parsing Analysis, SysML, XML.

WorldFallz’s picture

Just add another entry to the file:

127.0.0.1       ubercart.webel.com.au

Then add a virtual host directive for it in your apache httpd.conf file. Something like:

<VirtualHost *>
  DocumentRoot /absolute/path/to/main/drupal 
  ServerName ubercart.webel.com.au
</VirtualHost>

They key is, the "DocumentRoot" needs to point to the main site of the multisite and not the /sites/ubercart.webel.com.au directory.

See HowTo: Configure your local workstation to serve multiple sites using Drupal's multisite configurations and Apache's VirtualHost for more info.

webel’s picture

@WorldFallz Thanks for helping us all (and for working late) so often ! Webel

Webel IT Australia, "Elements of the Web", Scientific IT Consultancy,
For PHP-driven Drupal CMS web sites, Enterprise Java, graphical UML, UML Parsing Analysis, SysML, XML.

WorldFallz’s picture

happy to help ;-)

nschloe’s picture

hi, in case you haven't found out yet:
instead of an alias, try the symlink "gallery->." within the drupal installation. that appears to work, see for example here.

anyway, *i* can't use symlinks, so any hints on clean urls on subsites with aliases would be HIGHLY appreciated.

cheers,
nico