0

I have a website in different languages, where "James" is the hypothetical person that's logged in. It has this logic.

Spanish

www.example.com/es/Login.php
www.example.com/es/Account.php
www.example.com/es/UpdateAccount.php
www.example.com/es/Logout.php

I want to make it look like this

www.example.com/
www.example.com/James 
www.example.com/James/UpdateAccount
www.example.com/James/Logout

Is this possible?

user5095266
  • 119
  • 2
  • 7

1 Answers1

0

Use the following as your .htaccess

RewriteEngine On
RewriteRule ^(\S{2})\/(\S+)$ $2.php?lang=$1

This will redirect you to the requested page for example:

http://www.example.com/es/Login

becomes

http://www.example.com/Login.php?lang=es

then load your language files based on the $_GET['lang']parameter.

And btw exposing the extension of your files is not harmful for your application's security.

Mumen Yassin
  • 502
  • 4
  • 16