Solved

redirect domain.com to www.domain.com

Posted on 2008-10-26
3
967 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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Hi, in this article I'm going to teach you how to run your own site, and how to let people in (without IP). I'll talk about and explain each step... :) By the way, everything in this Tutorial is completely free and legal. This article is for …
It is possible to boost certain documents at query time in Solr. Query time boosting can be a powerful resource for finding the most relevant and "best" content. Of course the more information you index, the more fields you will be able to use for y…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

789 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