View Single Post
Old 23rd January 2009, 23:11
pcxtra pcxtra is offline
Junior Member
Join Date: Nov 2008
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default Domain Forward http should not lower case

Issue + solution: I have a domain which needs to forward to another url with case sensitive URL. I used the domain forward form in the co-domain tab.

The forward URL should be something like
while ISPconfig forces to lowercase and will forward to

The piece of code responsible to force lowercase is in the file /root/ispconfig/scripts/lib/config.lib.php:

PHP Code:
  if(substr($domain["domain_weiterleitung"],0,4) == "http" || substr($domain["domain_weiterleitung"],0,4) == "HTTP"){
$domain["domain_weiterleitung"] = [COLOR="Red"]strtolower[/COLOR]($domain["domain_weiterleitung"]);
substr($domain["domain_weiterleitung"],-1) == "/"$domain["domain_weiterleitung"] = substr($domain["domain_weiterleitung"],0,-1);
$rewrite_rule .= "\nRewriteRule ^/(.*)         ".$domain["domain_weiterleitung"]."/$1 [L,R]";
          } else {
//if(substr($domain["domain_weiterleitung"],-1) != "/") $domain["domain_weiterleitung"] .= "/";
if(substr($domain["domain_weiterleitung"],0,1) != "/"$domain["domain_weiterleitung"] = "/".$domain["domain_weiterleitung"];
$rewrite_rule .= "\nRewriteRule   ^/(.*)$  http://".$servername.$domain["domain_weiterleitung"]."$1  [R]";
So locate the strtolower( ) call and remove it. This will prevent the forward URL to be converted to lowercase.

the correct result (after fix) in /etc/httpd/conf/vhosts/Vhosts_ispconfig.conf:

ewriteEngine on
RewriteCond %{HTTP_HOST} ^mysourcedomainn\.com [NC]
RewriteRule ^/(.*)$1 [L,R]
RewriteCond %{HTTP_HOST} ^www\.mysourcedomain\.com [NC]
RewriteRule ^/(.*)$1 [L,R]

Furthermore you cannot forward the main domain, but only the co-domain. I had to change the www of the main domain into 'forward' (or something else never used), then make two co-domains, one with www and one without and both to forward to the new URL.

Somthing ISPConfig could implement?
Reply With Quote
Sponsored Links