Solved

redirect domain.com to www.domain.com

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

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

In my business, I use the LTS (Long Term Support) versions of Linux. My workstations do real work, and so I rarely have the patience to deal with silly problems caused by an upgraded kernel that had experimental software on it to begin with from a r…
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 …
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

777 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