Go Back   CodingForums.com > :: Server side development > Apache configuration

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 12-17-2011, 10:54 PM   PM User | #1
emergence
New to the CF scene

 
Join Date: Dec 2011
Posts: 3
Thanks: 1
Thanked 0 Times in 0 Posts
emergence is an unknown quantity at this point
.htaccess: regex works in text editor, not in .htaccess redirect

Hello everyone,

I'm trying to set up a redirect that sends people to the right language subdirectory:

If the come throught the example.com or example.eu Domain (example.com/cur/...) without any language subdirectory (/en or /de), I want to send them to example.com/cur/en/...

And if they come through the example.de domain, and they don't have any language subdirectory, I want to send them to example.de/cur/de/...

My .htaccess:

Code:
<IfModule mod_rewrite.c>
RewriteEngine On
#RewriteBase /cur/

RewriteRule ^http://(www\.)?example\.(eu|com)/cur((?!/en|/de).)*$ http://$1example.$2/cur/en$4 [R=301,L]
RewriteRule ^http://(www\.)?example\.(de)/cur((?!/en|/de).)*$ http://$1example.$2/cur/de$4 [R=301,L]
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /cur/index.php [L]
</IfModule>
Can you see what I'm missing/messing up?

Thanks a lot!
emergence is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

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

Forum Jump


All times are GMT +1. The time now is 10:59 AM.


Advertisement
Log in to turn off these ads.