D
D
dk-web2015-09-23 21:12:58
PHP
dk-web, 2015-09-23 21:12:58

Is RewriteBase even necessary?

Friends, realizing that banality - I dare to ask for help.
I spent half a day "playing" with this htaccess. As a result, it only worked when I deleted this Rewritebase ...
I beg you, not with documentation, but with a real answer to help ... A lot of time is spent transferring the site to hosting - it should not be like
this locales:

Options -MultiViews
RewriteEngine On

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

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

There is an admin panel on the locale:
AuthType Basic
AuthName "Thats protected Area!"
AuthUserFile C:\xampp\htdocs\mysiteru\public\admin\.htpasswd
Require valid-user

Options -MultiViews
RewriteEngine On

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.+)$ index.php?url=$1 [QSA,L]

Hosting Root:
Options -MultiViews
RewriteEngine On

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

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

Hosting admin:
AuthType Basic
AuthName ' Admin'
AuthUserFile /home/u171101/mysiteru/www/admin/.htpasswd
Require valid-user

Options -MultiViews
RewriteEngine On

RewriteBase /admin/

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

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

I'm really confused ... by typing everything ... and sometimes it works, then it throws errors ...
How should it be? I would be grateful ... In
total, there are 4 htaccess options:
1) root on the locale
2) admin panel on the locale
3) root on the hosting
4) admin panel on the hosting.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
ShamblerR, 2015-09-25
@ShamblerR

needed and very much so.
Example if /
without directive $1= /var/www/site/web/четотам
with directive $1= /
Wash profit is obvious
now by
AuthUserFile /home/u171101/mysiteru/www/admin/.htpasswd
OpenServer and use the Linux path.
If it's just so impatient, then create such a folder in the structure, and make it a link.
You will be happy

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question