Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Regular Coder
    Join Date
    Jun 2002
    Posts
    358
    Thanks
    2
    Thanked 0 Times in 0 Posts

    multilingual url rewrite

    Hi,

    How to redirect

    http://www.abc.com/application/home/...en&action=test

    to

    http://www.abc.com/application/en/home/test

    by using htaccess?

    The application might have few different languages, so if possible i do not want to hardcoded. how do i work it out using htaccess & php?

    Thanks!
    Thanks.
    =====================================================
    From NinjaTurtle
    ++http://ohmygoh.blogspot.com|http://technology.ohmygoh.com++

  • #2
    New Coder
    Join Date
    Jan 2010
    Location
    In a dump
    Posts
    64
    Thanks
    9
    Thanked 2 Times in 2 Posts
    I think this is what you are looking for:

    Code:
    RewriteRule ^application/([^/\.]+)/home/([^/\.]+)/$ index.php?language=$1&action=$2
    Basically the ([^/\.]+) bits take in the dynamic bits like the language and the action and the $1 and $2 put them back into the php $_GET array.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •