如何重写主页?
如果文件夹中没有索引文件,我如何从另一个文件夹重写索引文件...例如主站点有两个像这样的文件夹,
main_folder/no index.php
folder1/index.php
folder2/index.php
我必须在重写规则中添加什么才能使主页显示索引folder1/index.php
编辑
让它与此一起工作
RewriteEngine On
RewriteCond %{HTTP_HOST} site.com
RewriteCond %{REQUEST_URI} !folder1/
RewriteRule ^(.*)$ folder1/$1 [L]
if there is no index file in the folder how do i rewrite an index file from another folder...so for example the main site has two folders like this
main_folder/no index.php
folder1/index.php
folder2/index.php
what do i have to put in the rewrite rule to make the main page show the index for folder1/index.php
EDIT
got it working with this
RewriteEngine On
RewriteCond %{HTTP_HOST} site.com
RewriteCond %{REQUEST_URI} !folder1/
RewriteRule ^(.*)$ folder1/$1 [L]
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
试试这个:
虽然编辑不确定
:对于子级别可能会添加这个解决方案。
Try this:
Not sure though
edit: for sub levels maybe adding this solves.
你只想要一个重定向吗?
do you just want a redirect?