Redirect subdomain from http://www to just http://?

General questions relating to Joomla! 1.5 There are other boards for more specific help on Joomla! features and extensions.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting.
Forum Post Assistant - If you are serious about wanting help, you should use this tool to help you post.
Locked
pablo631
Joomla! Apprentice
Joomla! Apprentice
Posts: 20
Joined: Tue Dec 23, 2008 3:36 pm

Redirect subdomain from http://www to just http://?

Post by pablo631 » Fri Mar 13, 2009 3:40 pm

Is it possible to have a redirect using htaccess that rewrites the a url that uses http://www.sub.domain.com to point to http://sub.domain.com? Sometimes users forget to NOT type in www. when trying to access a subdomain and they end up at my default site on my server. Which is a bit confusing for them. Any ideas?

User avatar
ooffick
Joomla! Master
Joomla! Master
Posts: 11615
Joined: Thu Jul 17, 2008 3:10 pm
Location: Ireland
Contact:

Re: Redirect subdomain from http://www to just http://?

Post by ooffick » Fri Mar 13, 2009 4:25 pm

Hi,

Put the following code into your .htaccess code of your default site:

Code: Select all

RewriteCond %{HTTP_HOST} ^www.sub.domain.com$ [NC]
RewriteRule ^(.*)$ http://sub.domain.com/$1 [L,R=301] 
Olaf
Olaf Offick - Global Moderator
learnskills.org

abrar226
Joomla! Apprentice
Joomla! Apprentice
Posts: 11
Joined: Fri Jan 30, 2009 11:02 pm

Re: Redirect subdomain from http://www to just http://?

Post by abrar226 » Sat Mar 28, 2009 12:47 am

thanks

barrycox
Joomla! Apprentice
Joomla! Apprentice
Posts: 19
Joined: Sat May 13, 2006 1:17 am

Re: Redirect subdomain from http://www to just http://?

Post by barrycox » Wed Nov 22, 2017 11:48 pm

is this still how to do this? somewhere along the line (i'm on joomla 3.8.2 now) it seems to have stopped working.


Locked

Return to “General Questions/New to Joomla! 1.5”