LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 11-21-2007, 09:42 AM   #1
sinister1
Member
 
Registered: Jul 2007
Posts: 70

Rep: Reputation: 15
rewrite rule base url apache2


Hai,

I have an url www.domain.eu?index.php?lang=es_es now i want to rewrite the url to:

www.anotherdomain.com?index.php?lang=es_es

is this possible and how? i've googled but didn't find an example of rewriting base url.

hope you can help me.


thanks!
 
Old 11-22-2007, 03:39 AM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,217
Blog Entries: 1

Rep: Reputation: 2070Reputation: 2070Reputation: 2070Reputation: 2070Reputation: 2070Reputation: 2070Reputation: 2070Reputation: 2070Reputation: 2070Reputation: 2070Reputation: 2070
You can use the following:
Code:
RewriteEngine on
RewriteCond %{HTTP_HOST}   !^$
RewriteRule   ^(.*)   http://www.anotherdomain.com/$1  [R,L]
You can take a look at the apache guide about rewriting.

Regards
 
Old 11-22-2007, 04:19 AM   #3
sinister1
Member
 
Registered: Jul 2007
Posts: 70

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by bathory View Post
You can use the following:
Code:
RewriteEngine on
RewriteCond %{HTTP_HOST}   !^$
RewriteRule   ^(.*)   http://www.anotherdomain.com/$1  [R,L]
You can take a look at the apache guide about rewriting.

Regards

Thank you for your answer.

The problem is that de initial domain multiple aliases has.

We've made another virtual host named: www.anotherdomain.com en in this we wil set the rewrite rules. This virtual host has de document root of our primaire domain.

Little bit a difficult story.


thanks again
 
Old 11-23-2007, 11:17 AM   #4
sinister1
Member
 
Registered: Jul 2007
Posts: 70

Original Poster
Rep: Reputation: 15
I fixed it.

Made a new index_es.php and set this one as default in my virtualhost but with the documentroot of the primaire website
 
  


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
Turn ON "URL rewrite" in Apache2 (debian etch) swmok Linux - Server 2 11-19-2007 05:02 AM
Apache rewrite rule help kinetik Linux - Software 1 11-05-2007 12:18 PM
i need a rewrite rule!help arcow Linux - Enterprise 1 07-03-2007 06:37 AM
Exception in mod-rewrite rule Boby Programming 0 01-17-2006 08:40 PM
Help me make this rewrite rule in Apache ganninu Linux - General 8 01-07-2004 09:30 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 01:15 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration