LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 10-08-2008, 06:52 AM   #1
mahmoud
Member
 
Registered: Apr 2006
Location: UK
Distribution: Mandriva, Debain, Redhat, Fedora, Ubuntu, FreeBSD
Posts: 269

Rep: Reputation: 30
Apache Rewrite


Hi
i want to rewrite some domains and not rewrite some in the same vhost file
is that possible e.g
www.test.nl should be rewritten to www.test.co.uk
www.test.it should be rewritten to www.test.co.uk
www.test.es should be rewritten to www.test.co.uk
www.test.de should be rewritten to www.test.co.uk
but
www.test.net should still be www.test.net
all in the same apache file
 
Old 10-08-2008, 07:56 AM   #2
Jurrian
Member
 
Registered: Sep 2008
Posts: 58

Rep: Reputation: 15
Well I think your solution is in writing a small script. The only thing I don't know is how you split up text in a script, but your script should look something like this:


Code:
tmp = splitString to string to be equalised
remain = remaining of string you splitted
if(tmp = it || tmp = nl)
output = "remain + co.uk"
else if(tmp = es)
output = "remain + co.uk"

etc.
However, if you only want to replace when it's .net, you should:

Code:
if(tmp = net)
{
    output = $1
}
else
{
   output = "remain + co.uk"
}

echo output
I know my syntax is not correct, but I hope I gave you an idea how to solve your problem.

Jurrian

Last edited by Jurrian; 10-08-2008 at 07:59 AM.
 
Old 10-08-2008, 08:11 AM   #3
mahmoud
Member
 
Registered: Apr 2006
Location: UK
Distribution: Mandriva, Debain, Redhat, Fedora, Ubuntu, FreeBSD
Posts: 269

Original Poster
Rep: Reputation: 30
thanks but i figured it out
i just created a new rewrite rule after the existing one
 
  


Reply


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
apache rewrite help deesto Linux - Server 3 11-03-2006 02:07 PM
Need help with Apache rewrite kinetik Linux - General 6 05-19-2006 06:02 AM
Apache 2 Rewrite One Domain To Another thunder04 Linux - Software 10 04-19-2006 01:38 AM
apache mod rewrite Robert0380 Linux - Software 5 07-31-2003 04:42 PM
Apache Rewrite Not Working mikeyt_333 Linux - General 1 05-20-2003 05:00 PM


All times are GMT -5. The time now is 07:33 PM.

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