开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜