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=29)
-   -   website subdomain wildcard support (http://www.howtoforge.com/forums/showthread.php?t=45771)

agramajo 11th May 2010 22:58

website subdomain wildcard support
 
Hi!

With a simple modification we can have a wildcard in our website subdomain.

Example:
You want this, wildcard subdomain: *.example.com redirects to example.com

Go to: Sites -> Websites -> Subdomain for website -> Add new subdomain
Host: *
Domain: example.com
Redirect Type: No redirect

Then ISPConfig will generate "example.com.vhost" with:
...
ServerAlias *.example.com

Test it and use at your own risk.

I wait that this little patch could be included in next release. Only it allows * in regex domain verification. I use it in my production servers (Debian 5).

http://people.baicom.com/~agramajo/p...wildcard.patch

# wget ...
# cd /usr/local/ispconfig
# patch -p0 < ispconfig3_website-subdomain-wildcard.patch

I saw a post with a different solution.

Regards,
Alejandro

mike_p 12th May 2010 00:12

either I misunderstand your request or this already exists:
when you add/edit a domain there is a feature "auto-subdomain"

agramajo 12th May 2010 02:03

Mike, you are right. I completely miss the "*." option in "auto sub-domain".

It is not necessary to patch it. I selected now that option.

And the ISPConfig generate "example.com.vhost" with:
...
ServerAlias *.example.com

Wow! ISPConfig3 don't forget nothing about Apache config. :-D

Regards,
Alejandro


All times are GMT +2. The time now is 06:36.

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