How to do a redirect get request on a page on the main except for some pages?


Warning: count(): Parameter must be an array or an object that implements Countable in /home/styllloz/public_html/qa-theme/donut-theme/qa-donut-layer.php on line 274
0 like 0 dislike
28 views
There is such a structure:
Main (index.php)
- 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:

RewriteEngine on
RewriteRule ^(.*)$ user.php?login=$1 [L]

But with this option, entering at the website.ru/user1 get the error.

If you write:

RewriteEngine on
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)
by | 28 views

2 Answers

0 like 0 dislike
by
0 like 0 dislike
HET is not part of the url and does not go in the rewrite rule.
To highlight, we use a two-tier design
Also all that $1 of Konda it will be %1

# 301 --- www.test.com/faq.html?faq=13&layout=bob => www.test2.com/faqs.html
RewriteCond %{HTTP_HOST} ^www\\.test\\.com$
If the host such
RewriteCond %{QUERY_STRING} (^|&)faq\\=13($|&)
And if there is a get request so that
RewriteCond %{QUERY_STRING} (^|&)layout\\=bob($|&)
And THERE is such a request, the Exception is !
RewriteCond %{QUERY_STRING} !(^|&)layout\\=bob2($|&)
To implement such a rule
RewriteRule ^faq\\.html$ http://www.test2.com/faqs.html? [L,R=301]

This design is not mandatory(^|&)faq\\=13($|&)
Can be abbreviated to faq\\=13 but the Constitution chose the option Amaranta without it.
Also pay vnimanie at the end of the steering column that has to be the end ? it is in this writing will remove the get parameters is
by

Related questions

0 like 0 dislike
1 answer
asked May 21, 2019 by neMaster
0 like 0 dislike
1 answer
0 like 0 dislike
1 answer
asked Jun 5, 2019 by doorway-team
0 like 0 dislike
3 answers
110,608 questions
257,187 answers
0 comments
40,796 users