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 18th May 2007, 01:21
torusturtle torusturtle is offline
Senior Member
 
Join Date: Apr 2006
Posts: 296
Thanks: 21
Thanked 24 Times in 16 Posts
Send a message via ICQ to torusturtle Send a message via AIM to torusturtle
Lightbulb keeping subdomain URL in browser address bar

When creating a codomain (subdomain) and forward it to an internal folder the address bar of the browser changes displaying the forwarded folder.

e.g. if you set the forward for sub.domain.tld to /sub/ you'll get domain.tld/sub/

There are to ways to keep sub.domain.tld.

1. Option
Change the code of ISPConfig like described here:
Co/sub-domains without rewritten URLs

2. Option
  1. Leave the forward value empty
  2. Add the following into the Apache Directives field:
Code:
RewriteEngine on
RewriteCond %{HTTP_HOST}   ^sub.domain.tld [NC]
RewriteRule   ^/(.*)$ /sub/$1  [L]
Reply With Quote
The Following 6 Users Say Thank You to torusturtle For This Useful Post:
badran (21st April 2008), falko (18th May 2007), madmucho (19th May 2007), mbria (15th November 2007), mturillo (22nd October 2008), pakogah (17th June 2008)
Sponsored Links
  #2  
Old 19th May 2007, 00:09
madmucho madmucho is offline
Senior Member
 
Join Date: Oct 2006
Location: Czech republic, Karlovy Vary
Posts: 158
Thanks: 79
Thanked 11 Times in 11 Posts
Send a message via ICQ to madmucho
Default

Thanks for nice how-to is very usefull.

when you want more rewrites for more subdomains simply do this rewrite

Code:
RewriteEngine on
RewriteCond %{HTTP_HOST}   ^sub1.domain.tld [NC]
RewriteRule   ^/(.*)$ /sub1/$1  [L]
RewriteCond %{HTTP_HOST}   ^sub2.domain.tld [NC]
RewriteRule   ^/(.*)$ /sub2/$1  [L]
Will be very happy when someone integrate this to co-domain and that is created automaticaly if user want (radiobutton or something similiar).
Reply With Quote
  #3  
Old 24th May 2007, 18:19
sullast sullast is offline
Junior Member
 
Join Date: May 2007
Location: Ft Myers FL, USA
Posts: 6
Thanks: 1
Thanked 0 Times in 0 Posts
Send a message via ICQ to sullast
Default need help with this please

where it says sub.domain.tld do you replace that with your info thats reference in the co-domain page and where the /sub/ is you replace with the file location trying to use it for webmail redirection of squirrelmail.pkg without the address changing, also i only have the one site and the one redirect i'm trying to do i can't get either way mentioned in the forums to work for redirect without changing address
Reply With Quote
  #4  
Old 29th May 2007, 22:59
torusturtle torusturtle is offline
Senior Member
 
Join Date: Apr 2006
Posts: 296
Thanks: 21
Thanked 24 Times in 16 Posts
Send a message via ICQ to torusturtle Send a message via AIM to torusturtle
Default

I guess you got it right.
Problem could be that squirrelmail.pkg gets installed outside the domains folder and thus can't get redirected to.
Reply With Quote
  #5  
Old 20th June 2007, 23:39
H2SO4 H2SO4 is offline
Junior Member
 
Join Date: May 2007
Posts: 28
Thanks: 6
Thanked 1 Time in 1 Post
Default

Quote:
Originally Posted by torusturtle
2. Option
  1. Leave the forward value empty
  2. Add the following into the Apache Directives field:
Code:
RewriteEngine on
RewriteCond %{HTTP_HOST}   ^sub.domain.tld [NC]
RewriteRule   ^/(.*)$ /sub/$1  [L]
1. ok
2. need a admin, reseller or customer can't.

so i need to give admin access for all customer ?

Quote:
Originally Posted by madmucho
Will be very happy when someone integrate this to co-domain and that is created automaticaly if user want (radiobutton or something similiar).
i agree with you.

Last edited by H2SO4; 2nd August 2007 at 21:24.
Reply With Quote
  #6  
Old 27th July 2007, 15:09
punto punto is offline
Member
 
Join Date: Jul 2006
Posts: 84
Thanks: 12
Thanked 2 Times in 1 Post
Thumbs up

that works well, thanks!
Reply With Quote
  #7  
Old 31st July 2007, 12:55
kanour kanour is offline
Member
 
Join Date: Jun 2006
Posts: 56
Thanks: 0
Thanked 0 Times in 0 Posts
Default In ISPConfig

You can write the directive in:

Site > Basis > Apache Directives (Optional):
Reply With Quote
  #8  
Old 2nd August 2007, 21:29
H2SO4 H2SO4 is offline
Junior Member
 
Join Date: May 2007
Posts: 28
Thanks: 6
Thanked 1 Time in 1 Post
Default

Quote:
Originally Posted by kanour
You can write the directive in:

Site > Basis > Apache Directives (Optional):
you can write with admin access only.
Reply With Quote
  #9  
Old 21st April 2008, 08:57
badran badran is offline
Junior Member
 
Join Date: Apr 2008
Posts: 9
Thanks: 1
Thanked 0 Times in 0 Posts
Default

When I add this:

Quote:
RewriteEngine on
RewriteCond %{HTTP_HOST} ^sub.domain.tld [NC]
RewriteRule ^/(.*)$ /SubFolder/$1 [L]
It acts as if there is a normal forward (using the ispconfig panel).
http://www.domain.tld/SubFolder/

If I add this:

Quote:
RewriteEngine on
RewriteCond %{HTTP_HOST} ^sub.domain.tld [NC]
RewriteRule ^/(.*)$ /SubFolder/$1 [L,R=302]
or this

Quote:
RewriteEngine on
RewriteCond %{HTTP_HOST} ^sub.domain.tld [NC]
RewriteRule ^/(.*)$ /SubFolder/$1 [L,R=301]
It gives me this result:
http://sub.domain.tld/SubFolder/SubF...der/SubFolder/...
Reply With Quote
  #10  
Old 21st April 2008, 14:55
torusturtle torusturtle is offline
Senior Member
 
Join Date: Apr 2006
Posts: 296
Thanks: 21
Thanked 24 Times in 16 Posts
Send a message via ICQ to torusturtle Send a message via AIM to torusturtle
 
Default

The subdomain and the folder must have the same name:

Code:
RewriteEngine on
RewriteCond %{HTTP_HOST}   ^mortimer.domain.tld [NC]
RewriteRule   ^/(.*)$ /mortimer/$1  [L]
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
sending e-mail using mail() function linuxuser1 HOWTO-Related Questions 38 21st April 2009 12:20
subdomain URL to webmail torusturtle Installation/Configuration 2 23rd August 2006 21:56
Forward on subdomain, but alias as url? OnTheRun Installation/Configuration 3 9th June 2006 23:25
Mail address at subdomain dlikar Installation/Configuration 1 7th June 2006 10:42


All times are GMT +2. The time now is 22:47.


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