结构就像这样
htdocs
somefiles
myfolder/image
/js
index.html
style.css
protected
/models
/controllers
/blahblabha
index.php
.htaccess
我想重定向整个应用,指向myfolder 所以我在浏览器中键入的URL,它将被重定向到 myfolder目录的index.html
答案 0 :(得分:0)
你想在你的htaccess文件中输入这样的东西:
RewriteEngine On
RewriteCond %{REQUEST_URI} !^/myfolder
RewriteCond %{DOCUMENT_ROOT}/myfolder%{REQUEST_URI} -f [OR]
RewriteCond %{DOCUMENT_ROOT}/myfolder%{REQUEST_URI} -d
RewriteRule ^(.*)$ /myfolder/$1 [L]
显示不存在的网址:
RewriteCond %{REQUEST_URI} !^/myfolder
RewriteCond %{DOCUMENT_ROOT}/myfolder%{REQUEST_URI} !-f
RewriteCond %{DOCUMENT_ROOT}/myfolder%{REQUEST_URI} !-d
RewriteRule ^(.*)$ /myfolder/ [L]