apache - Redirect ?lang=en string to subfolder /en -


I want to redirect as many as this pattern:

domain com / xxx /? Lang = en to domain.com/en/xxx/

For example:

Domains. Com / About /? Lang = en to domain.com/en/about/

all links to * /? Lang = en code> just one goal.

  rewrite% {QUERY_STRING} ^ lang = en RewriteRule ^ en / about /? [R = 301, L]    

You can use these rules in your root .htaccess :

  rewinding sign on rewrite% {THE_REQUEST} \ s / + ([^ /] + \ / \? Lang = ([^ \ s & amp; +++] [NC] rewritable ^ /% 2 /% 1? [R = 302, L] Revoked% {REQUEST_FILENAME}! -d Rewrite% {REQUEST_FILENAME}! -f Riveritium ^ ([ed] {2}) / ([^ /] +) /? $$ 2? Once the code is working properly, LAN = $ 1 [L, QSA]   

change 302 to 301 once.

Comments

Popular posts from this blog

ios - Adding an SKSpriteNode to SKScene from a child SKSpriteNode -

Matlab transpose a table vector -

c# - Textbox not clickable but editable -