.htaccess - Config version check in Apache -


I am reviving an Apache-PHP application. The main goal is to make it easily portable among hosts. I have moved every path-based setting from .htaccess files to virtualhost specification, but to match the version of the config file in the site's version It would be nice to be able.

What I have thought is the two constants defined in the vhost config (such as environment variables) such as:

  • less warsense in which this configuration file Compatible with is the lowest version of the application.
  • highVersion containing

    then the central .htaccess file of the application can check whether:

    • If the lower version is not bigger than the version of the application and
    • if the high quality app is less than the minimum config version required by

      I know that know about SetEnv, SetEnvIf and Rewrite, but they do not support the least number of fonts as compared to the numbers.

      Of course, I can use a special number system:

      • 3 = iii
      • 4 = iiii
      • etc.

        ... and use RegEx to compare them (if one is more than one in another then this is bigger), but there is something else ... meaningful solution: < /p>

        Apache can have a comparison of mod_rewrite such as id & gt; ; 1234 - This string will be compared as a comparison ( lexicographically prefix and lexicographically low ).

        Real Life Example

        Actions: are pages such as /198655.html . From 152600 and 153655 on all pages, the / us / sub-fold and all others need to redirect 301 for the / en / subfolder.

        Code: Rewrite $ 1> 152600 rewrite $ 1 & lt; 153655 rewriting rule ^ (\ d +) \. Html $ http://www.example.com/us/ $ 1.html [R = 301, L] revised rule ^ (\ d +) \. Html $ http://www.example.com/en/$1.html [R = 301, L]

        You can compare numbers - this is not correct and the number accordingly It is possible to format .. but it is possible in simple cases. If you can simplify your number (like 04> <11> and 4 <11> compare ) then it can work for you.

Comments

Popular posts from this blog

mysql - BLOB/TEXT column 'value' used in key specification without a key length -

c# - Using Vici cool Storage with monodroid -

python - referencing a variable in another function? -