Htaccess conditional statements based on server / path name

Is it possible to write some conditional if statements in htaccess based on the server name / path?

I know what I can use <IfModule>, but this does not solve the problem when the development and production server is identical.

thank

+3
source share
1 answer

You can check the value of SERVER_NAME or DOCUMENT_ROOT:

RewriteCond %{SERVER_NAME} =foo
RewriteRuleRewriteCond %{DOCUMENT_ROOT} =/path/to/document/root/
RewriteRule
+4
source

Source: https://habr.com/ru/post/1728603/


All Articles