My problem is that clean urls are not working on some of my sites, while it does on others. The current setup looks like this

-sites
--default
--personal.com
--beta.company1.com
--beta.company2.com
each with:
---settings.php
---files
---themes
and so on

On my default site, the clean urls work. However on personal.com, beta.company1.com, and beta.company2.com clean urls will not work. If I place the $db_url information of the default site into one of the other sites(personal.com, etc.) the clean urls work. Until a few moments ago, when I was trying the above procedure, beta.company2.com didn't allow clean urls as stated above, but when I changed the $db_url back to its correct value and added $base_url = 'http://beta.company2.com'... clean urls magically worked and without me even setting it! So, this leads me to a very thankful conculsion that .htaccess(mod_rewrite) is not the culprit, because I hated configuring it the first time around. But it also further puzzels me to why clean urls are still not working on some of my sites?
If the above(cheap hack) had worked on the other sites I would not be typing this message. Adding $base_url to the settings.php file for beta.company1.com did not make clean urls work. So I'm back to square one.

Any ideas???

Comments

mo6’s picture

Have a look at your webserver configuration for the domains, what's different for the domains?

pumazi’s picture

Good point. I looked and couldn't find beta.company2.com in my virtual host region, because I forgot to place it in there. So at the moment beta.company2.com is just using the default(main domain) server configuration, which uses drupal as its base dir(/www/htdocs/{drupal files}) and uses the 'default' site(sites/default). In other words default--and now beta.company2.com--are using the main server configuration, while virtualhosts like beta.company1.com and personal.com are not.
Here is a snippet of how my virtual hosts are setup:

<VirtualHost 1.22.333.444:80>
    User           company1
    Group          vusers
    ServerName     beta.company1.com
    ServerAdmin    webmaster@beta.company1.com
    DocumentRoot   /www/htdocs
    CustomLog      /usr/local/apache/logs/company1/beta.company1.com-access_log combined
    ErrorLog       /usr/local/apache/logs/company1/beta.company1.com-error_log
</VirtualHost>

Notes:
-/www/htdocs is a symlink to /usr/local/apache/htdocs
-personal.com is setup the same way except it has 'ServerAlias www.personal.com'

I'm guessing what you pointed out is that something in my main server configuration is missing in my virtual hosts' configuration?
Here is some info from the main server configuration:

Port 80
User webby
Group webby
ServerAdmin webmaster@main.domain.net
ServerName main.domain.net
DocumentRoot "/usr/local/apache/htdocs"
{SSL Directives (not important to show)}
<Directory />
    Options FollowSymLinks
    AllowOverride None
</Directory>
<Directory "/usr/local/apache/htdocs">
  Options Indexes FollowSymLinks MultiViews
  AllowOverride All
  Order allow,deny
  Allow from all
</Directory>
{mod_userdir and directory directive}
<IfModule mod_dir.c>
    DirectoryIndex index.html index.htm index.cgi index.php index.shtml
</IfModule>
AccessFileName .htaccess
UseCanonicalName On
{mod_mime}
DefaultType text/plain
{mod_mime_magic}
HostnameLookups Off
{Logging directives}
{mod_alias, mod_autoindex, mod_mime, mod_setenvif, and mod_php4}
<IfModule mod_rewrite.c>
  RewriteLog "/www/logs/rewrite.log"
  RewriteLogLevel 0
</IfModule>

I don't see a huge difference... and I thought virtual hosts inherited alot of the main servers configuration?
Further ideas???

pumazi’s picture

Fixed it by placing this directive in...

<Directory "/usr/local/apache/htdocs">
        Options Indexes FollowSymLinks MultiViews
        AllowOverride All
        Order allow,deny
        Allow from all
</Directory>

You definitely set me on the right track so thanks. And thank you for the reply, because I usually don't even get that :P

darthcheeta’s picture

i found this worked for me too. i'm running a multisite deployment with drupal in a folder called /drupal/ under the document root. i had to add the block for each site in httpd.conf like this:

<VirtualHost *>
    ServerName domain_name.com
    ServerAlias www.domain_name.com
    DocumentRoot /www/htdocs/drupal
	<Directory "/www/htdocs/drupal">
	Options Indexes FollowSymLinks MultiViews Includes
	AllowOverride All
	Order allow,deny
	Allow from all
	</Directory> 
 </VirtualHost >

 <VirtualHost *>
    ServerName another_domain_name.com
    ServerAlias www.another_domainname.com
    DocumentRoot /www/htdocs/drupal
	<Directory "/www/htdocs/drupal">
	Options Indexes FollowSymLinks MultiViews Includes
	AllowOverride All
	Order allow,deny
	Allow from all
	 </Directory>
</VirtualHost>

urls got clean and mean as soon as i restarted apache.

gcassie’s picture

I spent a long time trying to figure out how to get multisite clean urls working. I was sure I had my virtual hosts set up properly, but they just weren't working. Eventually I looked into the global Apache config, and there I found that the server only had an address name for a virtual server on port 80. I added another for port 443 and the clean URLs started working.

I just though I would mention this since most discussions on this topic seem to focus on individual virtual hosts, and my problem ended up being a global option. If you're stuck on this, pull back and look at the server config as a whole!

So glad this is working now.

ptamas’s picture

the solution works fine...for folks with access to httpd.conf. Any suggestions for folks who don't have this access? and...would this explain why I can't see the theme screenshots in admin/themes on a subdomain.mainsite.com where that site is housed in /sites/subdomain.mainsite.com with modules, themes, files and settings php where they belong?

-p