![]() |
Co/sub-domains without rewritten URLs
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? |
i love you :P
|
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? :o |
Quote:
|
Wow, you rock! I was looking for 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/sho...=co-domains#22 what do you think?:rolleyes: |
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. |
Maybe you must change a DirectoryIndex directive somewhere?
|
Sorry i Have a question.
by the code Code:
... "\nRewriteRule ^/(.*)$ http://".$servername.$domain["domain_weiterleitung"]."$1 [R]";Also this Part ? Code:
$rewrite_rule .= "\nRewriteCond %{HTTP_HOST} ^".$rewrite_cond_url." [NC]";Greetz Pierre |
| All times are GMT +2. The time now is 05:32. |
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2013, vBulletin Solutions, Inc.