开发者

Is there any way to avoid having a separate .htaccess file for every environment (i.e. test, uat and prod)

开发者 https://www.devze.com 2023-02-03 21:26 出处:网络
Is there a way to use the same version of an .htaccess file for different environments?When doing a rewrite for a permanent redirect, you need to use a fully qualified url.Something like:

Is there a way to use the same version of an .htaccess file for different environments? When doing a rewrite for a permanent redirect, you need to use a fully qualified url. Something like:

RewriteCond %{QUERY_STRING} element1=one
RewriteRule index\.php http://www.domain.com/path [L,R=3开发者_StackOverflow中文版01]

Is there any way to use an environment variable for the domain? Other solutions?

Thanks for the help...


Could you use VirtualServer's on your Apache global configuration? Using VirtualServers you could get the same results without the need of an .htaccess file by changing the web server's root path or setting specific rewrite rules for each virtual server on apache's configuration file.

0

精彩评论

暂无评论...
验证码 换一张
取 消