我已经在这上面工作了两天了。阅读我能找到的关于.htaccess重写的所有内容。但我还是没能得到我想要的。
这就是我所拥有的:
http://www.domain.com/this/andthis/function.file-get-contents/这就是我需要的:
http://www.domain.com/this/andthis/由于某些原因,浏览器转到http://www.domain.com/我的htaccess文件包含以下两行:
RewriteCond %{REQUEST_URI} (.*)(function\.file-get-contents)
RewriteRule . $1 [R=301]另外,我找不到%{REQUEST_URI}是什么.我觉得自己有点傻。
我做错了什么?有什么想法吗?
发布于 2011-07-17 20:34:36
试试这个:
RewriteRule ^(.*)function\.file-get-contents $1 [L,R=301]在这里,您不需要RewriteCond。
发布于 2011-07-17 20:33:46
就这么做吧
RewriteRule (.*)/(.*)/function\.file-get-contents $1/$2 [R=301]https://stackoverflow.com/questions/6723813
复制相似问题