Hi, I've recently overcome a much debated situation, I needed subdomain support without URL rewriting. For this example let's assume the site's primary domain is domain.tld and we'd like to create test.domain.tld with totally separate content. The standard ISPConfig way of sub-domain creation is as follows: - Add a new co-domain - Hit the Forward option and put a folder's name in there - Create the folder in the webroot With this setup, if you visit http://test.domain.tld you'll get served with the content of the desired folder, though the mod_rewrite operation takes place in a manner not hidden from the user so thus the address in the URL bar of the browser immediately switches to http://domain.tld/test to show the real path the content is coming from. This sometimes is not desirable, so I needed a "fix". Here it is: In /root/ispconfig/scripts/lib/config.lib.php at line 1368 remove the text [R]. Explanation: The R flag tells mod_rewrite that when it applied the rewrite rule on the URL it shall not feed it to Apache "URL to file parsing" mechanism internally, but start a whole new request by rewriting the address in the user's browser and reloading it. Hope it helps some who wants to achieve the same behavior. I've got confirmation from Till that this modification does not break any part of the code, but you need to note that this solution is not upgrade persistent. This means that any time you upgrade ISPConfig this file might get overwritten. Furthermore as so many people would like to see this function added to ISPConfig, it'd be nice to somehow implement this one leaving the existing feature intact. A "Do you want rewritten URLs" checkbox on the Forward tab maybe?
is this effect all rewrite URL HI sfrank, is this modification will effect SEF modules such asin CMS(like joomla) and .htaccess if I want to use it?
I'm sorry but I've got no idea... All I cared was making sure no existing functionality in ISPConfig shall break. Maybe, if you could give me more details on what functionality you're fearing to get broken when you say .htaccess I might be able to answer it, but it's way to general like this.
yes it working BUT yes its working but after reading howtoforge, I get better idea doing what till recommend: http://www.howtoforge.com/forums/showthread.php?t=4948&page=3&highlight=co-domains#22 what do you think?
The point of this is to keep it all under the same website. Yea, creating a new website works fine, but not the way some of us want.
I noticed a problem. Now this could be with my install, but I have a subdomain setup (using this trick). There is an index.php there, and I get an internal server error unless I type in /index.php. And no, I dont have this problem any other times.
Sorry i Have a question. by the code Code: ... "\nRewriteRule ^/(.*)$ http://".$servername.$domain["domain_weiterleitung"]."$1 [R]"; Must i Remove ONLY the PART with [R] or the complete Line ? Also this Part ? Code: $rewrite_rule .= "\nRewriteCond %{HTTP_HOST} ^".$rewrite_cond_url." [NC]"; if(substr($domain["domain_weiterleitung"],0,4) == "http" || substr($domain["domain_weiterleitung"],0,4) == "HTTP"){ $domain["domain_weiterleitung"] = strtolower($domain["domain_weiterleitung"]); if(substr($domain["domain_weiterleitung"],-1) == "/") $domain["domain_weiterleitung"] = substr($domain["domain_weiterleitung"],0$ $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]"; Thx for Help. Greetz Pierre
I did this by patching line 1410 in ISPConfig 2.2.24...works nicely. However, there seems to be a little sideeffect: Error-Pages are not shown anymore for these subdomains. If I just try to get a non-existant-link, I only get the standard error-page from IE. It doesn't matter to take my own error-pages or the once that come with ISPConfig. So this seems to be a little disadvantage with this patch...
prob okey ... i made the changes .. the index.php is visible and url is a.sometnin.com but .. when i watn to procede with anotehr page .. i got this .. Not Found The requested URL /page.php was not found on this server. Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request. what gets wrong .. isp is 2.2.32 ________ VIDEOS PORNOS ________ LIST OF MAZDA FACILITIES PICTURE
for now .. http://a.sometni.com to looks like a.sopmetni.com not like sometnin.com/a/ when i "\nRewriteRule ^/(.*)$ http://".$servername.$domain["domain_weiterleitung"]."$1 [R]"; remove the - [R] in the address bar address is visible like i want - s.sometin.com but ... the links between files r missing for example when i browsing the pages when [R] is there .. i can open page1.php from page.php . but when [R] is removed -> page1.php gets 404 page not found ________ Buy no2 vaporizer
? any idea whats wrong ? ________ Subaru Srd-1 History ________ Ford Vx54 Platform Picture ________ Ordinary Life Insurance Advice
2 thoughts on this 1.) First thing is: I have had run webs in such pseudo subdomains (by [R]-deletion-hack) without errors. But I had always to inject an apache directive into this kind of co-subby-domain-thingy like "RewriteBase /" (written into .htaccess). A CMS like e. g. Drupal runs this way without problems. 2.) The summary for me is that this is a bad replacement for real Apache subdomains, which can have always an own DOCUMENT_ROOT, own statistics etc. - However, good news: there is a way to hand real Apache subdomains to customers! How? Let them be resellers!. You can this way control: how many "webs" (= subdomains) customers may have, e. g. "3" how many domains customers may have, e. g. "1" how many diskspace of the "reseller" space a web/subdomain may have, e. g. 500MB of "resellers" 2GB total; if or if not an customer is allowed to inject own apache directives (surely not recommended) that the customer may not edit DNS resords. Thats a lot! An almost perfect solution. Except maybe: some irritations based on hardcoded naming conventions, like the term "Reseller" or "Customers" inside the navigation. Anyway, whatever works ...