[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[cobalt-developers] Mod rewrite causing error 400?



Hi everyone,
On our Cobalt raq550 we use a virtual host with an inexistent domain name
'non-existant.com' to add a rewrite rule to access
folder/subfolder/subfolder through so called subdomains of another
virtualhost of an existing domain 'existing.com'.

example : http://www.existing.com/members/joh/john/  is accessible through
http://www.john.existing.com

Till yesterday we did all of this on a Cobalt raq4 without a problem but on the
raq5 we experience alot of 400 Bad Requests when accessing some of the
subdomains. When you refresh the browser, the page does get displayed.

Here are the vhosts files of the dummy and real domain.

[admin conf]$ cat vhosts/site1
# owned by VirtualHost
NameVirtualHost 80.x.x.3 (IP address)

# frontpage needs the following four things to be here
# otherwise all the vhosts need to go in httpd.conf, which could
# get very large since there could be thousands of vhosts
Port 80
ServerRoot /etc/httpd
ResourceConfig /etc/httpd/conf/srm.conf
AccessConfig /etc/httpd/conf/access.conf

<VirtualHost 80.x.x.3>
ServerName www.non-existant.com
ServerAlias non-existant.com
ServerAdmin admin
DocumentRoot /home/.sites/28/site1/web
ErrorDocument 401 /error/401-authorization.html
ErrorDocument 403 /error/403-forbidden.html
ErrorDocument 404 /error/404-file-not-found.html
ErrorDocument 500 /error/500-internal-server-error.html
RewriteEngine on
#RewriteCond %{HTTP_HOST}                !^80.x.x.3(:80)?$
#RewriteCond %{HTTP_HOST}                !^www.non-existant.com(:80)?$
[NC]
#RewriteRule ^/(.*)                      http://www.non-existant.com/$1
[L,R]
RewriteCond   %{HTTP_HOST}                 ^www\.[^.]+\.centerall\.com$
RewriteRule   ^(.+)                        %{HTTP_HOST}$1          [C]
RewriteRule
^www\.(([a-z0-9][a-z0-9][a-z0-9])[a-z0-9]+)\.existing\.com(.*)
/home/.sites/106/site3/web/members/$2/$1/$3
#RewriteOptions inherit
AliasMatch ^/~([^/]+)(/(.*))?
/home/.sites/28/site1/users/$1/web/$3
# BEGIN WebScripting SECTION.  DO NOT EDIT MARKS OR IN BETWEEN.
AddHandler server-parsed .shtml
AddType text/html .shtml
AddType application/x-httpd-php .php4
AddType application/x-httpd-php .php
# END WebScripting SECTION.  DO NOT EDIT MARKS OR IN BETWEEN.
</VirtualHost>
# end of VirtualHost owned section
[admin conf]$ cat vhosts/site3
# owned by VirtualHost
NameVirtualHost 80.x.x.3

# frontpage needs the following four things to be here
# otherwise all the vhosts need to go in httpd.conf, which could
# get very large since there could be thousands of vhosts
Port 80
ServerRoot /etc/httpd
ResourceConfig /etc/httpd/conf/srm.conf
AccessConfig /etc/httpd/conf/access.conf

<VirtualHost 80.x.x.3>
ServerName www.existing.com
ServerAlias www.existing.com
ServerAdmin admin
DocumentRoot /home/.sites/106/site3/web
ErrorDocument 401 /error/401-authorization.html
ErrorDocument 403 /error/403-forbidden.html
ErrorDocument 404 /error/404-file-not-found.html
ErrorDocument 500 /error/500-internal-server-error.html
RewriteEngine on
RewriteCond %{HTTP_HOST}                !^80.x.x.3(:80)?$
RewriteCond %{HTTP_HOST}                !^www.existing.com(:80)?$ [NC]
RewriteRule ^/(.*)                      http://www.existing.com/$1 [L,R]
RewriteOptions inherit
AliasMatch ^/~([^/]+)(/(.*))?
/home/.sites/106/site3/users/$1/web/$3
# BEGIN WebScripting SECTION.  DO NOT EDIT MARKS OR IN BETWEEN.
AddType application/x-httpd-php .php4
AddType application/x-httpd-php .php
# END WebScripting SECTION.  DO NOT EDIT MARKS OR IN BETWEEN.
php_admin_value sendmail_path
 "/usr/sbin/sendmail -t -i -finfo@xxxxxxxxxxxx"
</VirtualHost>
# end of VirtualHost owned section

Does anyone have any idea what could cause these 400 errors???

How can we add this special rewrite rule to the real domain and keep the existing rewrite rule too?

Brgds,
Reginald