If you have complete control over both systems, use the Apache httpd.conf file. It can handle everything that .htaccess can and more, and is preferred above .htaccess for speed and security reasons.
If for some reason you need to divide the settings over multiple files (eg. some settings are common among the systems and should be under version control, others not), you can use include directives in the httpd.conf file like S.Lott says.
If you don't have control over httpd.conf in both systems, I don't know whether include directives are supported there; however you could try to use conditional blocks in your htaccess file as explained here.
发布评论
评论(1)
如果您可以完全控制这两个系统,请使用 Apache httpd.conf 文件。它可以处理 .htaccess 可以处理的所有内容,甚至更多,出于速度和安全原因,它比 .htaccess 更受青睐。
如果由于某种原因您需要将设置划分到多个文件中(例如,某些设置在系统中是通用的,应该受到版本控制,而其他设置则不是),您可以在 httpd.conf 文件中使用 include 指令,如 S.Lott 所说。
如果您无法控制两个系统中的httpd.conf,我不知道那里是否支持包含指令;但是,您可以尝试在 htaccess 文件中使用条件块,如此处< /a>.
If you have complete control over both systems, use the Apache httpd.conf file. It can handle everything that .htaccess can and more, and is preferred above .htaccess for speed and security reasons.
If for some reason you need to divide the settings over multiple files (eg. some settings are common among the systems and should be under version control, others not), you can use include directives in the httpd.conf file like S.Lott says.
If you don't have control over httpd.conf in both systems, I don't know whether include directives are supported there; however you could try to use conditional blocks in your htaccess file as explained here.