htaccess redirect add querystring
www.myweb.com to www.myweb.com/?lang=en
Any try i made redirect all the traffic in the website or creates a loop.
A开发者_Go百科ny help?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;
}
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 ;)
精彩评论