LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 08-04-2006, 03:46 AM   #1
kinetik
Member
 
Registered: Dec 2005
Location: The most beautiful city in the world.
Distribution: Mostly RedHat. Also Suse, Ubuntu, PHLAK etc.
Posts: 149

Rep: Reputation: 15
Apache rewrite question


Hi again friends


Wasn't too long before I came across a head-scratcher again, so here goes:


I have a website, let's call it www.kinetikpage.com


I have it set up as a virtual host in my httpd.conf file:

Quote:
<VirtualHost *>
ServerAdmin kinetik@kinetikpage.com
ServerName kinetik-en_EN
DocumentRoot "/data01/kinetik/en_EN/"
ErrorLog /var/www/html/kinetik-en_EN_error.log
TransferLog /var/www/html/kinetik-en_EN_access.log
RewriteEngine On
RewriteCond %{REQUEST_URI} !^/cps/rde/xchg/*
RewriteCond %{REQUEST_URI} !^/cps/rde/xbcr/*
RewriteCond %{REQUEST_URI} !^/(40(1|3|4)|500).html
RewriteCond %{REQUEST_URI} !^/searchbook/*
RewriteCond %{REQUEST_URI} !^/static/*
RewriteRule ^(.*\.htm*) http://www.kinetikpage.com/xchg/en_division_web_live/hs.xsl$1
RewriteRule ^(.)$ http://www.kinetikpage.com/xchg/en_division_web_live$1

</VirtualHost>
Now I have the same page in a different language, let's say french. I want it set up as a seperate virtual host and name it www.kinetikpage.com/f

Here's how I tried it:

Quote:
<VirtualHost *>
ServerAdmin kinetik@kinetikpage.com
ServerName kinetik-fr_EN
DocumentRoot "/data01/kinetik/fr_EN/"
ErrorLog /var/www/html/kinetik-fr_EN_error.log
TransferLog /var/www/html/kinetik-fr_EN_access.log
RewriteEngine On
RewriteCond %{REQUEST_URI} !^/cps/rde/xchg/*
RewriteCond %{REQUEST_URI} !^/cps/rde/xbcr/*
RewriteCond %{REQUEST_URI} !^/(40(1|3|4)|500).html
RewriteCond %{REQUEST_URI} !^/searchbook/*
RewriteCond %{REQUEST_URI} !^/static/*
RewriteRule ^(.*\.htm*) http://www.kinetikpage.com/f/xchg/fr_division_web_live/hs.xsl$1
RewriteRule ^(.)$ http://www.kinetikpage.com/f/xchg/fr_division_web_live$1

</VirtualHost>
When I type in , it correctly redirects to When I type in , it incorrectly redirects to instead of ...

What am I doing wrong? As always, a beer will be promptly delivered to anyone who helps (just put it on my tab)!

Last edited by kinetik; 08-04-2006 at 04:14 AM.
 
Old 08-04-2006, 05:03 AM   #2
cdhgee
Member
 
Registered: Oct 2003
Location: St Paul, MN
Distribution: Fedora 8, Fedora 9
Posts: 513

Rep: Reputation: 30
I'm not sure you're allowed to have multiple virtual hosts with the same hostname. Try combining the two virtual host sections and having both sets of rewrite rules in the one section.
 
Old 08-04-2006, 09:16 AM   #3
kinetik
Member
 
Registered: Dec 2005
Location: The most beautiful city in the world.
Distribution: Mostly RedHat. Also Suse, Ubuntu, PHLAK etc.
Posts: 149

Original Poster
Rep: Reputation: 15
OK, new question.


I get the above right when I do www.kinetikpage.fr.com, but not when I do the www.kinetikpage.com/f...


Is there any way of making it work with www.kinetikpage.com/f?

I'm also thinking that the rewrite rules for .com and .com/f clash somehow, but I'm not sure how to change it...
 
  


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


Similar Threads
Thread Thread Starter Forum Replies Last Post
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
Need help with Apache rewrite rules?? latino Programming 0 12-24-2004 02:09 AM
apache mod rewrite Robert0380 Linux - Software 5 07-31-2003 04:42 PM
Apache rewrite question CrazyToon Linux - Software 3 06-17-2003 02:00 PM


All times are GMT -5. The time now is 11:07 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