Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Cherokee: users

Subdomain module for drupal and rewrite rules.

 

 

Cherokee users RSS feed   Index | Next | Previous | View Threaded


email at davebv

Oct 17, 2009, 4:43 AM

Post #1 of 2 (409 views)
Permalink
Subdomain module for drupal and rewrite rules.

Hello,
I am trying to set up a module for drupal which requires rewrites and
wildcard virtual hosts.

I am not able to make it work, and I tried a few things.

These are the instructions:

1. edit some files in drupal installation... (which I already done, and
seems to be ok)

2. Enable wildcard in the dns host provider (already done)

3. Configure wildcard virtual hosts.

Apache (with mod_rewrite):
NameVirtualHost *:80
<VirtualHost *:80>
ServerAdmin webmaster [at] example
DocumentRoot /var/www/html
ServerName example.com
ServerAlias *.example.com

<Directory "/var/www/html">
AllowOverride All
</Directory>
</VirtualHost>

Lighttpd:
Edit your lighttpd.conf file, enable the evhost module,
and append the following, modifying directories as appropriate:

$HTTP["host"] =~ "([^.]+)\.([^.]+)$" {
evhost.path-pattern = "/var/www/%2.%1/html/"
}

# Apply the following drupal rewrite rules to subdomain URLs
# moving subdomain to the 1st argument in the path
# e.g. bob.example.com news.mysite.net
$HTTP["host"] =~ "^([^.]+)\.([^.]+)\.([^.]+)$" {
url.rewrite-final = (
# More than one argument
"^/([^.?]*)\?(.*)$" => "/index.php?q=_%1/$1&$2",
# No arguments
"^/([^.?]*)$" => "/index.php?q=_%1/$1",
)
}

What I did in cherokee was appart from having a drupal installation running:

In the drupal virtual host, in hosts, added the wildcard so I pick up
domains:
*.example.com

In behaviors:

added a regex rule: ^([^.]+)\.([^.]+)\.([^.]+)$
handler:
regular expresion: ^/([^.?]*)\?(.*)$ redirects to
/index.php?q=_%1/$1&$2
and ^/([^.?]*)$" redirects to
/index.php?q=_%1/$1

For matching hosts, I also tried with ([^.]+)\.([^.]+)$ instead of
wildcards, but does not seems to work.
Does somebody see what I am doing wrong?

Thanks for the help


alvaro at octality

Oct 17, 2009, 5:01 AM

Post #2 of 2 (385 views)
Permalink
Re: Subdomain module for drupal and rewrite rules. [In reply to]

Hello David,

On 17/10/2009, at 13:43, David Becerril wrote:

> In behaviors:
>
> added a regex rule: ^([^.]+)\.([^.]+)\.([^.]+)$
> handler:
> regular expresion: ^/([^.?]*)\?(.*)$ redirects to /
> index.php?q=_%1/$1&$2
> and ^/([^.?]*)$" redirects to /
> index.php?q=_%1/$1
>
> For matching hosts, I also tried with ([^.]+)\.([^.]+)$ instead of
> wildcards, but does not seems to work.
> Does somebody see what I am doing wrong?

Have you tried to trace it with the CHEROKEE_TRACE?

http://www.cherokee-project.com/doc/dev_debug.html

That's the most convenient way to debug this sort of configuration
issues.

--
Octality
http://www.octality.com/

_______________________________________________
Cherokee mailing list
Cherokee [at] lists
http://lists.octality.com/listinfo/cherokee

Cherokee users RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.