HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials

HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials (http://www.howtoforge.com/forums/index.php)
-   Tips/Tricks/Mods (http://www.howtoforge.com/forums/forumdisplay.php?f=19)
-   -   keeping subdomain URL in browser address bar (http://www.howtoforge.com/forums/showthread.php?t=12783)

torusturtle 18th May 2007 02:21

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]


madmucho 19th May 2007 01:09

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).

sullast 24th May 2007 19:19

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

torusturtle 29th May 2007 23:59

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.

H2SO4 21st June 2007 00:39

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 ? :confused:

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.

punto 27th July 2007 16:09

that works well, thanks! ;)

kanour 31st July 2007 13:55

In ISPConfig
 
You can write the directive in:

Site > Basis > Apache Directives (Optional):

H2SO4 2nd August 2007 22:29

Quote:

Originally Posted by kanour
You can write the directive in:

Site > Basis > Apache Directives (Optional):

you can write with admin access only.

badran 21st April 2008 09:57

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/...

torusturtle 21st April 2008 15:55

The subdomain and the folder must have the same name:

Code:

RewriteEngine on
RewriteCond %{HTTP_HOST}  ^mortimer.domain.tld [NC]
RewriteRule  ^/(.*)$ /mortimer/$1  [L]



All times are GMT +2. The time now is 21:35.

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