0

How can I do it right? If subdomain is not "dev" follow these instructions

RewriteEngine On
Options +MultiViews
Options +FollowSymlinks

# -----------------%<-----------------
# If subdomain is not "dev"
RewriteCond %{HTTP_HOST} !^dev\.*
# follow these instructions
AddHandler fcgid-script .php
MultiviewsMatch Handlers Filters
# -----------------%<-----------------

Cem Firat
  • 390
  • 2
  • 21

1 Answers1

1

That is nothing you should configure in a distributed configuration file (".htaccess"), that is not what those files are for. Instead this should be implemented in a separate virtual host where you don't need a condition at all.

A RewriteCond is part of the rewriting module, you cannot somehow use it in combination with directives of other modules.

You can try something like that, but as said I would advise against that:

<If "%{HTTP_HOST} == 'dev.example.com'">
    AddHandler fcgid-script .php
    MultiviewsMatch Handlers Filters
</If>

This is where you can find the documentation: https://httpd.apache.org/docs/2.4/expr.html#examples

arkascha
  • 41,620
  • 7
  • 58
  • 90