对整个目录的Apache重写规则 [英] Apache rewrite rule for whole directory

查看:160
本文介绍了对整个目录的Apache重写规则的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想提出一个重写规则

RewriteRule /test /my/long/path/index.html

但我的index.html读取其他文件,阿贾克斯,所以它不是简单的工作这样。我需要的目录结果所有子文件规则
我想:

but my index.html fetch other files, by ajax, so it's not working simple like this. I need a rule for all subfiles of the directory
I tried:

RewriteRule /test /my/long/path/
RewriteRule /test/* /my/long/path/*

但我结束了一个有趣的重定向<一个href=\"http://my.domain.co/test/index.html/index.html/index.html/index.html/index.html/index.html/index.html/index.html/index.html/index.html/index.html/index.html/index.html/index.html/index.html/index.html/index.html/index.html/index.html/index.html/index.html/\" rel=\"nofollow\">http://my.domain.co/test/index.html/index.html/index.html/index.html/index.html/index.html/index.html/index.html/index.html/index.html/index.html/index.html/index.html/index.html/index.html/index.html/index.html/index.html/index.html/index.html/index.html/

对不起,我在Apache的无知,和THX

Sorry for my ignorance in Apache, and thx

推荐答案

您重写规则是无效的。试试这个:

Your RewriteRule is not valid. Try this instead:

RewriteRule ^test(/.*)?$ my/long/path$1

这篇关于对整个目录的Apache重写规则的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆