D
D
dk-web2015-09-18 12:16:35
PHP
dk-web, 2015-09-18 12:16:35

How to correctly compose htaccess for the admin panel?

Here's what I ran into ...
I made the admin panel with one access point -
And now htaccess does not work - I honestly did it according to the "textbooks" - so I can hardly understand all these rewrites ...

AuthType Basic
AuthName "Thats protected Area!"
AuthUserFile /localhost/my_site/public/admin/.htpasswd
Require valid-user

Options -MultiViews
RewriteEngine On

RewriteBase /my_site/public/admin

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f

RewriteRule ^(.+)$ index.php?url=$1 [QSA,L]

Accordingly, the file with the password lies nearby.
Authorization window - I enter the login and password and "hello" ...
Server error!
The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there was an error in a CGI script.
If you think this is a server error, please contact the webmaster.
Error 500

How to fix?...

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Chernykh, 2015-09-18
@sashkets

this config from .htaccess file??
if so, then in it we refer to ourselves,
do this
AuthUserFile /localhost/my_site/passwd
and enter the login / password in passwd

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question