首页 > 如何实现 Apache htaccess 如果文件存在就重写

如何实现 Apache htaccess 如果文件存在就重写

网站生成静态缓存,访问地址 /game/ ,要求假如 网站文件/data/cache/game_index.html 存在,那么重写到这里,否则重写到 /index.php?m=Game&c=Home&a=lst

自己在htaccess 中加入的代码:

RewriteCond data/cache/game_index.html -f
RewriteRule ^game\/?$ data/cache/game_index.html [L,QSA]

未实现。如何才可以实现?

【热门文章】
【热门文章】