php - htaccess language conversion -


i made website arabic , english. files stored in root directory. didn't made separate folder arabic or english nor file arabic or english. made 2 language array arabic or english. if url says arabic data arrayarabic fetch , same case of english.

what requesting convert current url

http://www.example.com/viewjob.php?job_id=11031 

i want convert if http://www.example.com/ar/viewjob.php?job_id=11031 there no separate folder ar.

please let me know... thanks.

you can accomplish quite mod_rewrite. when url starts either "ar" or "en", want take rest of url, , internally rewrite rest of url , append parameter rest of query string:

rewriteengine on  rewriterule ^(en|ar)/(.*)$ $2?lang=$1 [qsa,l] 

see the documentation.


Comments

Popular posts from this blog

asp.net mvc - SSO between MVCForum and Umbraco7 -

Python Tkinter keyboard using bind -

ubuntu - Selenium Node Not Connecting to Hub, Not Opening Port -