Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

Website and Server Administration Forum


You are currently viewing our Website and Server Administration Forum as a guest. Please register to participate.
Login



Reply
mod_rewrite: redirect by cname and language
Old 03-23-2010, 01:45 AM mod_rewrite: redirect by cname and language
Junior Talker

Posts: 1
Name: Adam Pyschny
Trades: 0
Hi,
I'm tinkering around with this one for several hours now...

What I try to accomplish is, to redirect
http://xrms.mydomain.com
to http://mydomain.com/xrms

and set up an language redirection by the users browsers preffered setting. this is the my .htaccess so far:

Code:
RewriteEngine On
Options FollowSymLinks

RewriteCond %{REQUEST_URI} ^/?$ [NC]
RewriteCond %{HTTP_HOST} ^xrms\..*$ [NC]
RewriteRule (.*) http://mydomain\.com/xrms [R,L]

RewriteCond %{REQUEST_URI} ^/?$ [NC]
RewriteCond %{HTTP:Accept-Language} (de) [NC]
RewriteRule ^(.*)$ http://www\.mydomain\.com/concrete_de/news [R,L]

RewriteCond %{REQUEST_URI} ^/?$ [NC]
RewriteCond %{HTTP:Accept-Language} (pl) [NC]
RewriteRule ^(.*)$ http://www\.mydomain\.com/concrete_pl/news [R,L]

RewriteCond %{REQUEST_URI} ^/? [NC]
RewriteRule ^(.*)$ http://www\.mydomain\.com/concrete_en/news [R,L]
As you see, the user shoul be forwarded to /xrms if domain begins with xrms.*. If not, the language handling comes into place:
move to german site if german is supported, polish site if polish and default to english site.

BUT: that doesn't work, thats why I'm hoping for some hints from you..

without the first rule, whe language handling works fine.
without the language-rules, the first one works fine, too.

but together they don't.
xrms.mydomain.com is handled by the other rules while it should not, and I am redirected to their destinies.

Any idea on this?
KieserFiller is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 03-31-2010, 11:05 AM Re: mod_rewrite: redirect by cname and language
L a r r y's Avatar
Super Talker

Posts: 103
Name: Larry K
Location: Arizona
Trades: 0
How about doing the redirect from xrms.domain to domain/xrms, then once there place the language selection process into the htaccess file at domain/xrms?
L a r r y is offline
Reply With Quote
View Public Profile Visit L a r r y's homepage!
 
Reply     « Reply to mod_rewrite: redirect by cname and language
 

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
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.09803 seconds with 12 queries