Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0001023 [SysCP] Userpanel minor always 2008-11-30 21:31 2009-04-17 08:57
Reporter monotek View Status public  
Assigned To Flo
Priority low Resolution fixed  
Status resolved   Product Version 1.4
Summary 0001023: Domain redirection causes infinite loop
Description I connected 2 domains to a customer. "domain.com" and "domain.de".

Now i want that all requests to "www.domain.com", "domain.com" and "domain.de" are redireted to "www.domain.de".

Therfore i editet the domains and added the follwoing to "Path or URL:":

"http://www.domain.de" [^] [^]

When i now try to access the site firefox an ie gives an error message, that the site has an redirect loop.

It works for the redirect from "www.domain.com" to "www.domain.de".
It also works for "domain.com" to "www.domain.de"
The problem is only the redirect from "domain.de" to "www.domain.de"

I allready tried to set "Add a www. ServerAlias:" to "no" but after that you cant create the www alias via customer panel. Error message:

"www is not allowed for subdomains."

I and very probably most of the customers dont want to use mod_rewrite.

I think such logic tests should be done by syscp, to simplify it for the customers.
Additional Information
Tags No tags attached.
Attached Files ? file icon customer_domains.php.patch [^] (492 bytes) 2009-02-09 13:43

- Relationships

-  Notes
(0000030)
monotek (reporter)
2008-11-30 21:34

Same Problem in lighttpd
(0000046)
JamieWolf (developer)
2008-12-01 12:38

Such a thing should _NOT_ be done by redirecting. Use mod_rewrite for such a purpose! Because with mod_rewrite you won't lose ?foo=bar
(0000048)
monotek (reporter)
2008-12-01 12:52
edited on: 2009-02-09 13:54

Customers dont have the possibility to use mod_rewrite in apache or to edit the lighttpd config.

Therefore this have to be done in syscp.

You even dont loose any vars or urls.

If your domain is "domain.de" and you set "URL (overrides path):" to "http://www.domain.com/" [^] you can even access "http://www.domain.com/faq.php" [^] and you will be redirected to "http://www.domain.de/faq.php". [^]

Thats no problem in apache or lighty.

Only difference between apache and lighty is, that you have to cut the trailing "/" in "URL (overrides path):" when using lighty.

This should be equalized. Otherwise you run in problems if you switch from apache to lighty.

(0000265)
monotek (reporter)
2009-02-09 13:26
edited on: 2009-02-09 14:57

The "www is not allowed for subdomains." error should only occur when "Add a www. ServerAlias:" is set to "yes". If "www is not allowed for subdomains." is set to "No" it should be possible to add a www subdomain.

I attached a patch for Syscp 1.4.2 which does this.

Redirection from domain.de to www.domain.de is now possible without problems.


This is only a workaround. Imho the best strategy is:

1.) Delete "Add a www. ServerAlias:" option in admin_domains.php
2.) When new domain is created the www alias should be added in customers domain menu. The customer now can easily edit alias and redirects of subdomain www by himself.

(0000379)
Flo (administrator)
2009-04-17 08:57

Thanks monotek for this simple approach. I fixed it in changeset 2713.
Indeed, adding a special www subdomain whenever a domain is added would make sense. But we have to be careful, because currently www.domain is just a serveralias, so this must be set, too.

-  SVN - commits
(#2713)
flo
2009-04-17 08:55
Adding www subdomain is now possible if wwwserveralias is disabled, fixes #1023
U trunk/syscp/customer_domains.php

- Issue History
Date Modified Username Field Change
2008-11-30 21:31 monotek New Issue
2008-11-30 21:34 monotek Note Added: 0000030
2008-12-01 12:38 JamieWolf Note Added: 0000046
2008-12-01 12:41 JamieWolf Priority normal => low
2008-12-01 12:41 JamieWolf Severity major => minor
2008-12-01 12:41 JamieWolf Summary Apache2 - Domain redirection to subdomain www causes loop => Domain redirection causes infinite loop
2008-12-01 12:52 monotek Note Added: 0000048
2008-12-01 12:55 monotek Note Edited: 0000048
2008-12-01 12:55 monotek Note Edited: 0000048
2008-12-01 16:58 monotek Note Edited: 0000048
2008-12-01 21:00 monotek Note Added: 0000069
2008-12-01 21:01 monotek Note Edited: 0000069
2009-02-09 13:26 monotek Note Added: 0000265
2009-02-09 13:43 monotek File Added: customer_domains.php.patch
2009-02-09 13:44 monotek Note Edited: 0000265
2009-02-09 13:48 monotek Note Edited: 0000265
2009-02-09 13:48 monotek Note Edited: 0000265
2009-02-09 13:49 monotek Note Edited: 0000265
2009-02-09 13:53 monotek Note Edited: 0000048
2009-02-09 13:53 monotek Note Deleted: 0000069
2009-02-09 13:54 monotek Note Edited: 0000048
2009-02-09 14:01 monotek Note Edited: 0000265
2009-02-09 14:33 monotek Note Edited: 0000265
2009-02-09 14:33 monotek Note Edited: 0000265
2009-02-09 14:34 monotek Note Edited: 0000265
2009-02-09 14:34 monotek Note Edited: 0000265
2009-02-09 14:57 monotek Note Edited: 0000265
2009-04-17 08:55 Flo Status new => assigned
2009-04-17 08:55 Flo Assigned To => Flo
2009-04-17 08:55 Flo Checkin
2009-04-17 08:55 Flo Status assigned => resolved
2009-04-17 08:55 Flo Resolution open => fixed
2009-04-17 08:56 Flo Target Version => 1.4.3
2009-04-17 08:57 Flo Note Added: 0000379
Footer