我想要做的是使用SetEnv作为动态URL。例如,对于index.php,我会这样做
<IfModule somemodule.c>
<Files index.php>
SetEnv somevariable
</Files>
</IfModule>但是,如果我想为index.php?something=123这样做,那么我应该在我的.htaccess中放什么呢?它会不会与SetEnvIf request_URI一起工作,因为我无法让它起作用。另一件我认为可能是解决方案是使用rewrite_mod,但我不知道如何做。提前感谢您的帮助!
发布于 2014-04-20 22:23:31
您可以使用mod_rewrite的E标志来设置环境变量:
RewriteEngine On
RewriteCond %{QUERY_STRING} ^something=123$
RewriteRule ^index\.php$ - [L,E=somevariable]https://stackoverflow.com/questions/23187211
复制相似问题