对不起,如果它是重复的,但我没有遇到符合我的queries.To的问题--简单地说,我把我的问题分成了三个parts.ie。
与
所以..。1.**动态转换
myfile_min_vXX.js --> myfile.js
myfile_min_vXX.css --> myfile.css通过mod_rewrite.These文件,可能是在子文件夹中,比如图片、scrpt、js、js、etc.So,我必须从根目录.htaccess文件中这样做。
2.**美化url.考虑-
mydomain/name1_val1/name2_val2/../namenN_valN ---> mydomain/file.php?name1=val1&name2=val2 ..在.htaccess中对此进行正则表达式转换超出了我的级别。
3.我需要一个good tutorial on mod_rewrite of Apache likely "Complete reference" type。
谢谢你的感激之情。
发布于 2011-09-15 17:53:47
数字1:
RewriteRule ^myfile_min_vXX.js$ script/myfile.js
RewriteRule ^myfile_min_vXX.css$ style/myfile.css数字2:
RewriteRule (.*)/(.*)/(.*)/(.*) file.php?$1=$2&$3=$4第3部分:我见过的最好的mod_rewrite教程是apache:http://httpd.apache.org/docs/current/mod/mod_rewrite.html
有关使用此mod的示例,请检查apache:http://wiki.apache.org/httpd/Rewrite
记住apache使用的是prel兼容的正则表达式:http://www.cs.tut.fi/~jkorpela/perl/regexp.html
发布于 2011-09-15 17:38:40
那我就从http://httpd.apache.org/docs/2.0/misc/rewriteguide.html开始。我不自称是mod_rewrite expect,所以我不会尝试其他的。:)
https://stackoverflow.com/questions/7434968
复制相似问题