K
K
Kirill2019-01-31 14:36:35
htaccess
Kirill, 2019-01-31 14:36:35

How to make an exception in htaccess?

Tell me please. There are these entries in htaccess:
RewriteCond %{THE_REQUEST} ^[AZ]{3,9}\ /([^/]+/)*(default|index|main)\.(html|php|htm)\ HTTP / [NC]
RewriteRule ^(([^/]+/)*)(default|main|index)\.(html|php|htm)$ https://site.ru/$1 [L,R=301]
How to add an exception for the /administrator page? She uses index.php to login to the admin area.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
dodo512, 2019-01-31
@kisaev

RewriteCond %{THE_REQUEST} ^\S+\ /(([^?/]+/)*)(default|index|main)\.(htm|php) [NC]
RewriteCond %1 !^administrator/
RewriteRule ^  https://site.ru/%1 [L,R=301,NE]

V
Viktor Taran, 2019-01-31
@shambler81

!- denial

RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /([^/]+/)*(default|index|main)\.(html|php|htm)\ HTTP/ [NC]
RewriteCond %{THE_REQUEST} !^тут ваша страничка/% [NC]
RewriteRule ^(([^/]+/)*)(default|main|index)\.(html|php|htm)$ https://site.ru/$1 [L,R=301]

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question