Answer the question
In order to leave comments, you need to log in
How to properly .htaccess "RewriteRule ^ %1/favicon.ico[L]"?
I do not understand why one conversion does not work.
There is .htaccess text below.
The only thing that doesn't work is:
RewriteCond %{SERVER_NAME} ^(www|blog|project|xerox)\.*
RewriteCond %{REQUEST_URI} ^/favicon.ico$
RewriteRule ^ %1/favicon.ico [L]
# Задает кодировку текста
AddDefaultCharset utf-8
# Отключаем слэш на директории
DirectorySlash Off
# Включаем работу механизмов преоброзования
RewriteEngine On
Options +SymLinksIfOwnerMatch
# Устанавливает базовый URL
RewriteBase /
# Останов зацикливания RewriteRule
RewriteCond %{ENV:REDIRECT_STATUS} .
RewriteRule ^ - [L]
#-------- robot.txt --------#
RewriteCond %{SERVER_NAME} ^(www|blog|project|xerox)\.*
RewriteCond %{REQUEST_URI} ^/robot.txt$
RewriteRule ^ robot.txt [L]
#-------- favicon.ico --------#
RewriteCond %{SERVER_NAME} ^(www|blog|project|xerox)\.*
RewriteCond %{REQUEST_URI} ^/favicon.ico$
RewriteRule ^ %1/favicon.ico [L]
#RewriteRule ^ project/favicon.ico [L]
#-------- Public file --------#
RewriteCond %{SERVER_NAME} ^(www|blog|project|xerox)\.*
RewriteCond %{DOCUMENT_ROOT}/%1/$1 -f
RewriteRule ^(resources/public.*)$ %1/$1 [L]
#-------- URL slash --------#
RewriteCond %{REQUEST_URI} ^(.+)/$
RewriteRule ^(.+)/$ https://%{SERVER_NAME}/$1 [R=301,L]
#-------- URL HTTPS --------#
RewriteCond %{HTTP:SSL} !=1 [NC]
RewriteRule ^(.*) https://%{SERVER_NAME}/$1 [L,R=301]
#-------- PHP script --------#
RewriteCond %{SERVER_NAME} ^(www|blog|project|xerox)\.*
RewriteRule ^ %1/index.php [L]
#-------- THE END !!! --------#
RewriteRule ^ - [R=404,L]
Answer the question
In order to leave comments, you need to log in
RewriteCond %{SERVER_NAME} ^(www|blog|project|xerox)\.* RewriteCond %{REQUEST_URI} ^/favicon.ico$ RewriteRule ^ %1/favicon.ico [L]
RewriteCond %{REQUEST_URI} ^/favicon.ico$
RewriteCond %{SERVER_NAME} ^(www|blog|project|xerox)\.*
RewriteRule ^ %1/favicon.ico [L]
RewriteCond %{SERVER_NAME} ^(www|blog|project|xerox)\.*
RewriteCond %{REQUEST_URI} =/favicon.ico
RewriteRule ^ %1/favicon.ico [L]
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question