Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.php > #17096

Set web page lang via .htaccess

From "dentysta" <witekr@interia.pl>
Newsgroups comp.lang.php
Subject Set web page lang via .htaccess
Date 2016-09-24 16:22 +0200
Organization Pro Futuro
Message-ID <ns626m$bb$1@opal.futuro.pl> (permalink)

Show all headers | View raw


Hi all,

I'm trying to prepare right .htaccee mod rewrite rules for my online shop.

On my store, lang is set by lang_id variable on the url:
http://mystore.com/index.php?lang_id=[pl, en, de] 

I need to rewrite this url to 
http://mystore.com/en/index.php

My .htaccess file alredy have following rule:

RewriteEngine On
RewriteBase /
RewriteRule ^(pl|en)/(.*)$  $2?lang_id=$1 [L,QSA]

How to redirect to (sufix with default lang_id):
http://mystore.com/en/index.php
after writing simple
mystore.com ?

The following rule, added to .htassess doesn't work properly 
:Location /
Redirect 301 /pl/index.php

pozdrawiam / best regards
Edentarius

Back to comp.lang.php | Previous | NextNext in thread | Find similar | Unroll thread


Thread

Set web page lang via .htaccess "dentysta" <witekr@interia.pl> - 2016-09-24 16:22 +0200
  Re: Set web page lang via .htaccess Jerry Stuckle <jstucklex@attglobal.net> - 2016-09-24 10:55 -0400
  Re: Set web page lang via .htaccess Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2016-09-24 21:44 +0200
    Re: Set web page lang via .htaccess Luuk <luuk@invalid.lan> - 2016-09-24 22:47 +0200
      Re: Set web page lang via .htaccess "R.Wieser" <address@not.available> - 2016-09-25 09:40 +0200

csiph-web