redirect目录使用Apache mod重写

我有名为/template/css目录

完整的url是http://sitename.com/template/css

我需要这个文件夹被redirect使用Apache国防部重写

 http://sitename.com/template/css 

至:

 http://sitename.com/css 

我怎样才能做到这一点?

为什么你需要使用mod_rewrite ? 为什么你不只是在CSS文件实际存储的文件系统中的位置?

假设你有一个合理的理由这样做,下面应该做的伎俩:

 RewriteEngine On RewriteRule ^/template/css(.*)$ /css$1