LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices

Reply
 
Search this Thread
Old 03-25-2009, 06:18 AM   #1
axelgenus
LQ Newbie
 
Registered: Mar 2006
Location: Italy
Distribution: Ubuntu 10.04
Posts: 19

Rep: Reputation: 0
National domains redirect


Hi guys,

I'm hosting some domains on my dedicated server. I'm using Apache to host web sites. One of my costumers asked me to host different national domains and a dot com. He wants to use this kind of redirect pattern:

domain.it -> domain.com/?lang=it
domain.fr -> domain.com/?lang=fr
domain.co.uk, domain.us => domain.com/?lang=en

I guess I have to use the apache rewrite engine... I tried and it works but I would like to implement something elegant and not a dozen of different VirtualHost's directives with the relative rewrite rule.

Any idea?
 
Old 04-13-2009, 06:55 PM   #2
Idle
LQ Newbie
 
Registered: Nov 2002
Location: Iceland
Distribution: RHEL, CentOS, Slackware
Posts: 26

Rep: Reputation: 15
An idea

Wouldn't ServerAlias directives in the base VirtualHost suffice? That is, rather than having "a dozen of different VirtualHost's directives", you'd simply add something along the lines of:
Code:
ServerAlias domain.it domain.fr domain.co.uk
to your <VirtualHost domain.com> section. Furthermore, you could put your RewriteRules in .htaccess.
 
  


Reply

Tags
apache, domains, locale


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Multiple domains in LDAP and 1 samba server for all domains, what to do? xnomad Linux - Server 1 11-14-2008 09:12 AM
National Do Not Call Registry Dragineez General 1 09-21-2007 11:38 AM
Sub Domains & Multiple Domains (Apache) lugos Linux - Server 1 09-01-2006 10:22 PM
your national flag acid_kewpie General 27 05-19-2006 11:48 AM
National character and UTF-8 pingu Linux - Software 3 04-20-2005 01:58 AM


All times are GMT -5. The time now is 08:41 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration