Best unofficial Apache Server developers community
Username
Forgot password?
Sign in with Twitter account
Sign in with Facebook account

How to set region with _SESSION

0

42 views

hi

how can I set the region (en, da, de etc) with mod_rewrite?

the rewrite condition has to look like this

www.domain.com/en/
www.domain.com/dk/
www.domain.com/de/
secure.domain.com/en/
secure.domain.com/dk/
secure.domain.com/de/

but how can I then set the region?

url to set region is

?set_lang=da

EDIT:

and can I somehow get _SESSION vars in the mod_rewrite expressions?

asked April 26, 2011 3:25 am CDT
posted via StackOverflow

1 Answers

0
Best answer
 

I found a solution

RewriteCond %{HTTP_HOST}        domain\.net$ [NC]
RewriteCond %{REQUEST_URI}      ^/(da|en)/(.*)(\?%{QUERY_STRING})?$ [NC]
RewriteRule ^(.*)$              /%2?%{QUERY_STRING}&set_lang=%1 [L]

answered May 1, 2011 6:40 pm CDT

Your answer

Join with account you already have


Sign in with Twitter account
Sign in with Facebook account
Sign in with Google Friend Connect

Preview