How to register rules .htaccess to replace URL?

Good day, Dear!

There was some problem. Need to replace the URL of the admin panel.
It is necessary that when you are asked to: domain.com/admin files were opened with: domain.com/webasyst but without redirect. That is so in your browser's address bar and remained domain.com/admin

Tell me, please.
For earlier, thank you!
September 26th 19 at 11:26
2 answers
September 26th 19 at 11:28
Something like this:
RewriteRule /admin/(.*) /webasyst/$1 [L]
Unfortunately not suitable. Gives 404 error.
Log:
[26/Jul/2014:19:24:50 +0400] "GET /admin/ HTTP/1.1" 404 15496 "-" "Mozilla/5.0 (X11; Linux i686) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.152 Safari/537.36" "-"
[26/Jul/2014:19:24:50 +0400] "HEAD /admin/ HTTP/1.1" 404 0 "http://domain.com/admin/" "Mozilla/5.0 (X11; Linux i686) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.152 Safari/537.36" "-"
[26/Jul/2014:19:24:50 +0400] "HEAD /admin/ HTTP/1.1" 404 0 "http://domain.com/admin/" "Mozilla/5.0 (X11; Linux i686) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.152 Safari/537.36" "-"
- bartholome_Franec commented on September 26th 19 at 11:31
Remove the / before admin - Melyssa commented on September 26th 19 at 11:34
Ie like this: RewriteRule ^admin/(.*) /webasyst/$1 [L] - Melyssa commented on September 26th 19 at 11:37
the same. - bartholome_Franec commented on September 26th 19 at 11:40
I don't know, works for me. Try it before to remove webasyst /
And generally, throw down his .htaccess, maybe a typo somewhere. - Melyssa commented on September 26th 19 at 11:43
Oh, and this is domain.com - this is the site where is located .htaccess, or is a third-party website that you want to do a redirect? - Melyssa commented on September 26th 19 at 11:46

<filesmatch "\.md5$">
 Deny from all
</filesmatch>

DirectoryIndex index.php
Options-Indexes
# Comment the following line, if the option Multiviews not allowed here
# Options-MultiViews

AddDefaultCharset utf-8

<ifmodule mod_rewrite.c>
 RewriteEngine On
 # Uncomment the following line, if you are having trouble
 # RewriteBase /

 RewriteCond %{REQUEST_URI} !\.(js|css|jpg|jpeg|gif|png)$
 RewriteCond %{REQUEST_FILENAME} !-f
 RewriteCond %{REQUEST_FILENAME} !-d
 RewriteRule ^(.*)$ index.php [L,QSA]
 RewriteRule ^admin/(.*) /webasyst/$1 [L]
</ifmodule>

<ifmodule mod_headers.c>
 <filesmatch "\.(jpg|jpeg|png|gif|js|css)$">
 Header set Cache-Control "max-age=3153600, public"
</filesmatch>
</ifmodule>

All in one website and a single server. - bartholome_Franec commented on September 26th 19 at 11:49
So the first rule works, the second does not reach the queue. - Melyssa commented on September 26th 19 at 11:52
Sorry. I'm very tight in this. Is it possible to combine? - bartholome_Franec commented on September 26th 19 at 11:55
Yes, I also not special. Think I found the cause: remove L from [L,QSA] - Melyssa commented on September 26th 19 at 11:58
Flag [L] means that other directives don't have to do :) - Melyssa commented on September 26th 19 at 12:01
Anyway does not want=(
Now this:
...
RewriteRule ^(.*)$ index.php [QSA]
RewriteRule ^admin/(.*) /webasyst/$1 [L]
...
- bartholome_Franec commented on September 26th 19 at 12:04
Well, now is definitely not to tell anything. I'm the same .htaccess created, and everything works as expected. Anyway, dig here. - Melyssa commented on September 26th 19 at 12:07
September 26th 19 at 11:30
Try:
RewriteRule /webasyst/(.*) /admin/$1 [L]
The same result. - bartholome_Franec commented on September 26th 19 at 11:33

Find more questions by tags htaccess