Solved

redirect domain.com to www.domain.com

Posted on 2008-10-26
3
961 Views
Last Modified: 2013-11-15
I am using googlemaps and the api key is for www.domain.com.

My website is both accessible at domain.com and www.domain.com by configuring a file in sites-avalaible as
ServerName www.domain.com
ServerAlias domain.com

The website use Joomla 1.5.7.

Hence i dont get a map for domain.com

Thanks
0
Comment
Question by:rroslan
  • 2
3 Comments
 
LVL 27

Accepted Solution

by:
caterham_www earned 500 total points
ID: 22810979
Try to place [1] into the file, where you placed 'ServerAlias domain.com'. But first, check your server config if the module mod_rewrite is loaded (LoadModule section).
[1]:
 

RewriteEngine on

RewriteCond %{HTTP_HOST} ^domain\.com

RewriteRule ^/(.*) http://www.domain.com/$1 [R=301,L]

Open in new window

0
 

Author Comment

by:rroslan
ID: 22812474
Theres a '\' in the above after the '^domain\.com' which I did not include, thought it might be a typo error. Anyway its working for the config as below. Thanks
<VirtualHost *>
DocumentRoot "/home/roslan/Joomla_RT_HiveMind_j15"
ServerName www.domaini.edu.my
ServerAlias domain.edu.my
RewriteEngine on
RewriteCond %{HTTP_HOST} ^domain.edu.my
RewriteRule ^/(.*) http://www.domain.edu.my/$1 [R=301,L]
<Directory "/home/roslan/Joomla_RT_HiveMind_j15">
allow from all
Options +Indexes
</Directory>
</VirtualHost>
0
 
LVL 27

Expert Comment

by:caterham_www
ID: 22814751
> Theres a '\' in the above after the '^domain\.com'

Yes, \. stands for period, otherwise the . (period) does not mean period but any characher in a regular espression.
0

Featured Post

Control application downtime with dependency maps

Visualize the interdependencies between application components better with Applications Manager's automated application discovery and dependency mapping feature. Resolve performance issues faster by quickly isolating problematic components.

Join & Write a Comment

If you use Debian 6 Squeeze and you are tired of looking at the childish graphical GDM login screen that is used by default, here's an easy way to change it. If you've already tried to change it you've probably discovered that none of the old met…
In Solr 4.0 it is possible to atomically (or partially) update individual fields in a document. This article will show the operations possible for atomic updating as well as setting up your Solr instance to be able to perform the actions. One major …
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now