There is such a structure:
- Login page (signin.php)
Sign - up page (signup.php)
- User page (user.php)
- Admin user (admin.php)
It works like this:
The user comes to the home, is authenticated and a session is created (if there is a session then redirects to admin.php)
For each user page user.php takes a get parameter to login. Therefore, if you contact us at the website.ru/user.php?login=user1, we see data user1 from database.
I want to convert the complex structure of the website.ru/user.php?login=user1
in the website.ru/user1
In the file .htaccess write the following:
RewriteRule ^(.*)$ user.php?login=$1 [L]
But with this option, entering at the website.ru/user1
get the error.
If you write:
RewriteRule ^m/(.*)$ user.php?login=$1 [L]
appeal at the website.ru/m/user1
everything works as it should.
Question - how to redirect all requests to the website.ru/user.php?login=user1
; to exclude the registration page, login and admin? Because if a person contact situp = I understand this will be perceived as сайт.ру/user.php?login=signin.php
Do not like can't deal with it. Can someone please help?
And if you can immediately with the exception of the extension .php in the address bar (which would .php did not show up)