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 8th June 2009, 03:28
lubos lubos is offline
Member
 
Join Date: Oct 2007
Location: Belfast, UK - NI
Posts: 59
Thanks: 29
Thanked 17 Times in 13 Posts
 
Lightbulb (Solution!) Redirect domain.com and co-domains to www.domain.com

I wanted to redirect mydomain.com to www.mydomain.com.

Furthermore I have other domains set as co-domains in ISPConfig2. Therefore I wanted to have all these co-domains (mydomain.net; mydomain.info; mydomain.eu etc.) redirected to their respective equivalents (www.mydomain.net; www.mydomain.info; www.mydomain.eu etc.) .

The solution for this is simple. Put following code into Apache Directives field:


Code:
RewriteEngine On
RewriteCond %{HTTP_HOST} !^www
RewriteRule (.*) http://www.%{HTTP_HOST}$1 [L,R]
Afterwards each domain will redirect to its respective www.domain.tld

Thanks developers for such excellent tool as ISPConfig!
__________________
Safe computer? Only when unplugged.
Reply With Quote
The Following 2 Users Say Thank You to lubos For This Useful Post:
falko (8th June 2009), madmucho (12th July 2009)
Sponsored Links
Reply

Bookmarks

Tags
domain, redirect

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


All times are GMT +2. The time now is 08:15.


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