重定向请求不是源自某些文件

时间:2018-08-08 18:16:23

标签: apache mod-rewrite

我有一个简单的结构,在其中文件夹中有.html格式的各种文件。除index.html外,我只想通过AJAX 访问文件。更好的说法是,只有两个文件ajax.jsmain.js直接访问.html文件。如果有人尝试通过在类似http://example.com/somefile.html?key=value&anotherKey=anotherValue的浏览器中键入URL来直接访问文件,则应将其重定向到http://example.com/index.html?orgin=somefile.html%3Fkey%3Dvalue%26anotherKey%3DanotherValue。如何使用.htaccess中的mod_rewrite实现此目的?

0 个答案:

没有答案
相关问题