Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > ISPConfig 2 > Tips/Tricks/Mods

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 13th February 2007, 09:47
sfrank sfrank is offline
Junior Member
 
Join Date: May 2006
Posts: 22
Thanks: 0
Thanked 4 Times in 1 Post
Default 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?
Reply With Quote
The Following 4 Users Say Thank You to sfrank For This Useful Post:
Been Told (17th January 2009), huschi (14th July 2008), minimalist (27th August 2009), PierreR32 (25th May 2007)
Sponsored Links
  #2  
Old 15th February 2007, 02:26
frk0r frk0r is offline
Junior Member
 
Join Date: Feb 2007
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

i love you :P
Reply With Quote
  #3  
Old 18th February 2007, 01:39
galaxyboss galaxyboss is offline
Junior Member
 
Join Date: Feb 2007
Posts: 13
Thanks: 1
Thanked 0 Times in 0 Posts
Talking 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?
Reply With Quote
  #4  
Old 19th February 2007, 09:53
sfrank sfrank is offline
Junior Member
 
Join Date: May 2006
Posts: 22
Thanks: 0
Thanked 4 Times in 1 Post
Default

Quote:
Originally Posted by galaxyboss
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.
Reply With Quote
  #5  
Old 19th February 2007, 19:07
thecaptainjs thecaptainjs is offline
Junior Member
 
Join Date: Jan 2007
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Wow, you rock! I was looking for this!
Reply With Quote
  #6  
Old 19th February 2007, 19:17
galaxyboss galaxyboss is offline
Junior Member
 
Join Date: Feb 2007
Posts: 13
Thanks: 1
Thanked 0 Times in 0 Posts
Default 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?
Reply With Quote
  #7  
Old 19th February 2007, 19:48
thecaptainjs thecaptainjs is offline
Junior Member
 
Join Date: Jan 2007
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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.
Reply With Quote
  #8  
Old 21st February 2007, 15:26
thecaptainjs thecaptainjs is offline
Junior Member
 
Join Date: Jan 2007
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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.
Reply With Quote
  #9  
Old 22nd February 2007, 20:56
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,722 Times in 2,563 Posts
Default

Maybe you must change a DirectoryIndex directive somewhere?
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Strange email problem for one of my domains... any help appreciated paulrobert_a Installation/Configuration 5 9th August 2010 14:15
Virtual Users And Domains With Postfix, Courier And MySQL Secondary MX acoghlan HOWTO-Related Questions 1 8th March 2008 05:02
different counting of domains torusturtle Feature Requests 7 9th May 2007 22:18
missing feature: email-aliases for multiple domains olaus Feature Requests 5 30th March 2006 12:07
Problem with Virtual Users And Domains With Postfix, Courier And MySQL Howto fenix Server Operation 4 11th March 2006 02:53


All times are GMT +2. The time now is 18:11.


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