我想要网址:
http://localhost/application/cms/css/style.css
转到
/application/www/cms/css/style.css
'application'文件夹是我的根,我的.htaccess文件和index.php所在的位置。我该如何做到这一点?
答案 0 :(得分:1)
通过httpd.conf启用mod_rewrite和.htaccess,然后将此代码放在DOCUMENT_ROOT目录下的.htaccess中:
Options +FollowSymLinks -MultiViews
# Turn mod_rewrite on
RewriteEngine On
RewriteBase /
RewriteRule ^(application)/([^/]+/css/style\.css)$ /$1/www/$2 [R,L,NC]