How to make an exception in htaccess?

0 like 0 dislike
131 views
Tell me, please. There are here such records in htaccess:

RewriteCond %{THE_REQUEST} ^[A-Z]{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 page /administrator? To enter the admin area it uses index.php
by | 131 views

2 Answers

0 like 0 dislike
RewriteCond %{THE_REQUEST} ^\\S+\\ /(([^?/]+/)*)(default|index|main)\\.(htm|php) [NC] RewriteCond %1 !^administrator/ RewriteRule ^ https://site.ru/%1 [L,R=301,NE]
by
0 like 0 dislike
!- denial
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\\ /([^/]+/)*(default|index|main)\\.(html|php|htm)\\ HTTP/ [NC] RewriteCond %{THE_REQUEST} !^does your page/% [NC] RewriteRule ^(([^/]+/)*)(default|main|index)\\.(html|php|htm)$ https://site.ru/$1 [L,R=301]
by

Related questions

0 like 0 dislike
2 answers
asked Aug 4, 2019 by kisaev
0 like 0 dislike
2 answers
asked Jul 19, 2019 by kisaev
0 like 0 dislike
2 answers
asked Jul 4, 2019 by kisaev
0 like 0 dislike
1 answer
asked Jun 10, 2019 by kursof1
0 like 0 dislike
1 answer
110,608 questions
257,187 answers
0 comments
40,796 users