HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials

HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials (http://www.howtoforge.com/forums/index.php)
-   General (http://www.howtoforge.com/forums/forumdisplay.php?f=15)
-   -   Domain Forward http should not lower case (http://www.howtoforge.com/forums/showthread.php?t=30574)

pcxtra 23rd January 2009 23:11

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 http://www.mydestdomain.com/pageXYZ.html
while ISPconfig forces to lowercase and will forward to
http://www.mydestdomain.com/pagexyz.html

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"]);
            if(
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 ^/(.*) http://www.mydestdomain.com/pageXYZ.html?/$1 [L,R]
RewriteCond %{HTTP_HOST} ^www\.mysourcedomain\.com [NC]
RewriteRule ^/(.*) http://www.mydestdomain.com/pageXYZ.html?/$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?

till 24th January 2009 09:57

I've added this to the bugtracker.


All times are GMT +2. The time now is 19:16.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.