Jump to content
Sign in to follow this  
son

Mod rewrite with language option

Recommended Posts

I use mod-rewrite as:RewriteRule ^([A-Za-z0-9_-]+)$ webs.php?id=$1 [NC] It rewrites all URLs ok. However, I need to insert a language option (Italian and English) and this does not work due to rewrite rule. Has anyone experience and let me know how to change my rewrite rule? Thanks,Son

Share this post


Link to post
Share on other sites

How do you want the language to appear in the URL? As a query string parameter, before the main path, after the main path?It's easiest if you want it in the query string:

RewriteRule ^([A-Za-z0-9_-]+)$ webs.php?id=$1 [NC,QSA]

  • Like 1

Share this post


Link to post
Share on other sites

On query string is fine. It is only for language swap anyway, lang is then stored in session... Thanks a lot, S

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...