0


I'm triying to redirect www.myweb.com to www.myweb.com/?lang=en
Any try i made redirect all the traffic in the website or creates a loop.
Any help?

1
  • could you update your question with the relevant content of your .htaccess file please :) Commented Apr 12, 2011 at 8:49

2 Answers 2

1

I thinkg it should be easier for you to set the GET variable lang to 'en' in php, rather than redirecting... In your code, before handling the lang variable, try:

if (!isset($_GET['lang'])) {
    $_GET['lang'] = 'en;
}
Sign up to request clarification or add additional context in comments.

Comments

0

If you need to do it via a rewrite rule for whatever reason, this worked for the simple example I tried:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^(.*)$ $1?lang=en [QSA]

Though there are similar questions on stack overflow you should check out: ModRewite and general searching ;)

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.