htaccess的重定向 [英] htaccess redirection

查看:200
本文介绍了htaccess的重定向的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个域 test.com

现在我已经在最新的文件中的 test.com/backup /

Now i have the latest files in test.com/backup/

现在,我需要的是,当我键入 test.com 的浏览器,它应该去的 test.com/backup /

Now , what i need is, when i type test.com in browser it should go to test.com/backup/

我怎么能写$ C $下,在 htaccess文件

How can i write code for that in htaccess file

推荐答案

如果你希望它是无声的:

If you want it to be silent:

RewriteEngine on
RewriteRule ^(.*)$ /backup/$1 [L,NC]

这将使 http://test.com/ 显示包含在 /备份/ 的文件,而无需备份在网址

This will make http://test.com/ appear to contain the files inside /backup/ without having backup in the url

这篇关于htaccess的重定向的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆